User-defined function for estimating coefficient of performance I am using hourly weather data to estimate performance of commercial refrigeration systems under various parameters. The formula for estimating co-efficient of performance (COP) of these systems is repeated for each hour. 

I defined a formula to do this calculation:

Public Function estimatedCOP(dischargeTemp As Double, suctionTemp As Double)

Dim a As Double, b As Double, c As Double, d As Double, e As Double, f As Double

a = 9.12808037
b = 0.15059952
c = 0.00043975
d = -0.09029313
e = 0.00024061
f = -0.00099278

estimatedCOP = a + b * suctionTemp + c * suctionTemp * suctionTemp + _
    d * dischargeTemp + e * dischargeTemp * dischargeTemp + _
    f * suctionTemp * dischargeTemp

End Function


The function is repeated twice in a column with 8,760 rows (each hour of the year).

This gives the expected result, but takes a long time to calculate and update (as it's repeated ~17,000 times). How can I improve the performance of this function?
You are using the Double data type for all variables. I think this is a good thing since it should avoid conversions. But it is probably too large for your purpose.

From the doc:


  Double (double-precision floating-point)  8 bytes
    -1.79769313486231E308 to -4.94065645841247E-324 for negative values


Source: Data type summary

Perhaps using the single data type is enough ?


  Single (single-precision floating-point)  4 bytes     -3.402823E38 to
  -1.401298E-45 for negative values
  1.401298E-45 to 3.402823E38 for positive values


You can try and compare results.

For reference a response I made on another topic, that includes comments about data types: Adding qty If duplicates keys found VBA



It is unfortunate that the variable names (a..f) are not descriptive and 
meaningful. That makes logic errors harder to spot since the variables look  all the same. Surely all those values have a meaning ?



Something else: if you are doing calculations in a loop and assuming this is in Excel, you can suspend automatic recalculation at the beginning of your procedure:

Application.Calculation = xlManual


Turn it back on when you are done:

Application.Calculation = xlAutomatic