According to this source and many others, with smithing skill at level 100 and all the smithing perks, I should be able to improve my armor by 20 points, but what I discovered is that it's not correct for me. For example Deadric Boots with 26 armor(which also doesn't match the wiki, it should be 18, and I don't have any perks in Heavy Armor) the improvement is to 42, so it's 16 points. I don't have any clothes, gear or active magical effect on me. Turned off all mods and it's still the same. What should I do?
The UESP Skyrim Armor page lists the following approximated armor rating formula:
- Armor rating = (base armor rating + item quality) × (1 + 0.4 × (skill + skill effect)/100) × (1 + unison perk† + Matching Set) × (1 + armor perk‡)
Now from the armor page you see that the Daedric boots have an armor rating of 18 which you have improved to legendary status (+20), the daedric boots should now have an armor rating of 38 before taking your character's skill into the equation. You have skill level 38 in heavy armor, no heavy armor perks, the Ancient Knowledge power and you have disabled all mods. From the powers page, you can read that Ancient knowledge is bugged and provides a 25% bonus to all armors except dwarven armor. According to the armor rating formula page, Ancient knowledge affects the skill level, acting as a fortify light/heavy armor effect.
Using this information we insert these values into the equation:
(18 + 20) x (1 + 0.4 * (38 * 1.25 / 100)) * 1 * 1 = ~45.22
Remember that the armor formula is approximate, the exact formula is unknown. The implementation may round the factors up, down or to nearest integer, or fast imprecise math functions may be used. I believe however that the Ancient knowledge bug is the source of the confusion and it has been fixed by the Unofficial Skyrim Patch.
By default, Ancient Knowledge both gives a 25% bonus to armor rating and it improves tempering by 15%. Smithing items to legendary with 100 skill and the material perk adds 20 to the main armor piece, but only 10 to everything else(secondary armor and weapons). In this case, we add 10 to the Daedric Gauntlet's base of 18, not 20. However, the tempering modifier from Ancient Knowledge should make that 10 into 11.5, meaning the piece alone is 29.5.
You get an extra .4% armor rating per skill level(1.4x at 100 skill), so at 38 skill you get 1.152x protection. That times 29.5 is 33.98. Finally, we factor in the 25% armor rating boost from Ancient knowledge, giving us a grand total of 42.48. This is rounded down in your inventory display to the observed 42 rating.
Edit: Regarding how your boots displayed 26(vs 18) before you improved them:
base rating x skill or 18x1.15= 20.7
skill modifed rating x ancient knowledge or 20.7x1.25=25.875
round up to 26 to get what you saw before tempering.