For our 4Runners, Torque uses the MAF to calculate air mass ingested and either the commanded or measured O2 lambda (air-fuel ratio) to convert air mass to fuel mass. Hopefully it uses the short term fuel trim to correct for MAF errors, however, piemmm (Torque developer) won't give any details on how he calculates mpg. Once you have fuel flow rate and your speed (via GPS or OBD, depending on how you've got Torque set up), you can calculate mpg.The trans temp is a straight read from the CAN bus after requesting it. The MPG is a calculation based on injector duty cycle/pulse width/# cy/rpm.... and a few other minor things depending on the app. It needs to understand the injector flow rating and the actual fuel pressure to come up with accurate MPG from that data. That is where the multiplier comes in.
The 'big' error Torque can't compensate for is variations in fuel density. Even the vehicle can't account for this, as the ECU determines mass of fuel to inject, not volume. There must be a conversion from mass to volume using an assumed density for the instrument panel to display mpg.
Torque also can't account for variations in ethanol content. Pure gas has a stoichiometric air-fuel ratio of ~14.7. E10 has a stoichiometric A/F of ~14.1. You can select gas, E10, E20, etc, but if you have a mix of pure gas and E10, or the E10 is actually E5, you'll get a small error from the difference in actual A/F ratio.