Although a double-double is not a rare achievement in the NBA, it would be nice to know how rare it is that someone had a double-double and scored at least 40 points. I would like to know how often this is achieved (there must be some averaging statistics). And what is the record of double-double that includes points? That is, which players in the NBA had the biggest number of points on a game and on that game they had at least double-double.
For the 2016-17 NBA season, there were 50 such double-doubles and 16(!) triple-doubles where 40 points were scored (thanks to Harden and Westbrook, and one time from Lebron). To recognize how rare it is though, there were only 8 of these triple-doubles for the whole period between 2000 and the start of last season.
It might be more helpful to show you how I got these numbers though--I'd suggest getting familiar with the Basketball Reference site (check out the full site menu). Besides finding specific player stats, you can find different kinds of streaks, team stats, season stats, and all kinds of interesting things with the search criteria.
For this particular question, it was rather simple: use the Player Game Finder page, select the season(s) you're interested in or any other criteria to narrow the search, and then under "Additional Criteria", choose PTS >= 40, and check either the "Double-Double" or "Triple-Double" box.