What MP3Mike said. It just is not, at all, tied to your driving style
The range displayed next to the speed indicator is indisputably the Rated Range, and it's based on measured capacity divided by a *constant* of around 242 wh/mi. That 242 wh/mi never changes in the calculation - ever, even if you're actually driving like a miser and getting 150wh/mi or driving like you stole it and you're pushing 500 wh/mi.
It's pretty straightforward now, with Ver. 9, to prove this is correct: Go to your energy app (Ver. 9), where the car does in fact explicitly estimate your remaining range based on your past 5/15/30 miles of driving (looking at the ave. wh/mi used in each of those three trailing mileage brackets). *AND* they provide your rated range estimate as well, to compare *against* the three "driving style" energy usage estimates (5/15/30 miles). The estimate based on your actual wh/mi used for the 5/15/30 brackets is rarely if ever the same range you see stated as the Rated Range in those three energy estimates (and note that the "rated range" indicated on those estimates is *always* *exactly* what's displayed to the right of your speed indicator)
With Ver. 9's energy app for the trailing 5/15/30 miles remaining range estimates (and the instant range estimate, which estimates remaining range based on your current/instant energy usage), I think we're done arguing about this driving style v. rated range argument. It's rated range, and there's definitive proof of this right in the car.
PS - Before Ver. 9, there was room to argue that maybe the stated range number was based partly on some sort of "driving style" because there was just that one range number available. But now, with the car explicitly giving you *separate* estimates based on driving style (or, rather, the resulting wh/mi used as a result of that style), and then even comparing it with another number in each instance, actually called "rated range", which number always corresponds to the number you see next to your speedo number, the game is truly over.
I believe Model S/X owners have had this sort of info available to them for a long while before Ver. 9 brought it to the 3, which is probably why they keep "SMH" when they saw us new 3 owners trying to figure this out. With Ver. 9, I see the light, mostly because it's so explicitly set out right there in the energy app, which the 3's never had before Ver. 9.