I am 100% sure that neither Nintendo, Gamefreak, or Pokemon company revealed all of the game calculations for stats and damage, and everything else.
There is no way a company would publicly display their in-game formulas for calculating all of these statistics; it would ruin the game! Everyone would be focused on perfecting their Pokemon's stats that they will think too hard and probably not have a good time playing the game or get frustrated! (People nowadays use this information for competitive battling purposes, a huge difference than the regular game playthrough.)
As for how people found out these formulas and information on game stats, its found by a group of curious individuals that want to get the core information in the Pokemon games.
People are able to look closely at stats, and compare them to growths, effects, level-ups, etc. It's like being in math class where you are given a set of numbers to input (stats), and out comes the outputs (stats growth afterwards), and you have to come up with an equation that works for all given numbers. Math math math is all it is.
Probably the way they did this instead of tedious math calculations could be simply taking the game cartridge and opening it up. (Hacking or modding the game if you will.)
I'm sure someone has built a type of program that is able to read files in the game cartridge's memory and extract formulas right there. The information is probably read as a bunch of numbers for each individual Pokemon (identification, base stats, moves, etc.) and reads off of those numbers to input in an equation, which is what gives you the numbers you see in the game. (Game emulators probably use those same files and input it into the rom so that the game does all its calculations properly.)
Everyone is free to do whatever they want with their games when they purchase it, and curious individuals get this information by modding the games and jotting info down so everyone can understand it better (sites like Bulbapedia and Serebii).
In summary: Gamefreak or other companies in development of this game will never release this kind of information because its just a feature in the game that is too technical for players to worry about normally. It should be let alone by the game to program these numbers for you. But obviously the more advanced and more experienced players will use this information to their advantage and play competitively, but that is because they want to know about the in-depth information.
I hope this answers your question and wasn't too long to read!