I had thought that a designed arcCos or ArcSin would be faster than going through the old atn() function and correction for quadrants.
I suspect the VBA Atn expression is so much faster on Intel-compatible CPUs because there are hardware instructions to calculate arctan and sqrt.
I don't know how WorksheetFunction.ACos is implemented. But there is no hardware instruction to calculate arccos directly.
I think of Excel as being made up of two parts: the worksheet part and the VB part.
Yes: an Excel thread and a VBA thread.
There is a link between the two parts that is surprisingly fast. However, setting up that link to transfer data has a large overhead.
The "link" is interprocess communication, a feature provided by the O/S. There is no overhead to set it up, certainly not a per-message basis. But interprocess communication is relatively slow compared to a VBA function call.
So if you want to use a worksheet function from VB you have to wait for the link to be opened up.
I disagree. The WorksheetFunction methods does not communicate with the Excel thread. In contrast, the Evaluate function does.
The WorksheetFunction methods are machine-language implementations that are intended to emulate Excel functions exactly. (I found some corner-case differences.) They are called directly from VBA.
So things that will take a lot of time will include those where you use VB to loop round a range of cells on the worksheet. Each transfer will incur an overhead.
That would be true if "c" were a type Range variable. But in that case, the VBA Atn expression and WorksheetFunction.ACos function take about the same amount of time (on my computer). In fact, the VBA Atn expression takes a little longer, presumably because of the several references to "c".
Instead, I presume that "c" is a VBA variable, preferrably type Double. In that case, I can duplicate Harry's observation within reason. Thus, Excel is not involved in either calculation.