If you are repeating the same section 4 time i would use an array for your variables,
so instead of having $rf1, $rf2, $rf3, $rf4
you have $rf[0], $rf[1], $rf[2], $rf[3],
to make these into variables, name the inputs to rf[].
It would seem that one of your variables involved in the calculation is being changed by either the form.php or calc.php, i would look through all of your code and see where the variables are mentioned.
Or if thats too much, just put echo statements at various points thru your code, the minute the print is wrong, you know where the variable was changed.