Yeah, thanks for pointing this out! So I guess the declaration forced me to be careful with input/output types and this indirectly helped performance.
I learned this fact from reading disscussion ForwardDiff: Using on functions that are defined on floats64 - #3 by IljaK91, although I haven’t figured out how to make autodiff work yet