Hi. Currently, rule machine supports basic math functions and also abs(), negate() rand() round(); I've used the all.
If it
a) is easy and
b) wouldn't consume too much memory on the Hubitat,
then math functions such as sin, cos, tan, pow, ln, log would be tremendously useful in implementing models related to real-world stuff like solar/power/circadian-cycles/process-lags/temperature-predictions etc.
Currently, I'm using crude polynomial approximations which are a) inaccurate and b) quite the PITA to code in RuleMachine. A quick search of the forum finds only one similar feature request (3 years ago), but maybe folks don't know how useful these functions are until they have them?
I don't have an answer for you but perhaps it is already available.
I've seen Hubitat has the ability to import certain special libraries. Some of these I've found in the documentation, some I've not found or not yet needed. Perhaps what you need is already available.
That will help for a custom app, which might be something the OP would be interested in doing, but it won't help with Rule Machine (the question at hand). On a related note, I just tried this in webCoRE and didn't find any, either.
(And on another related note, if you are interested in writing a custom app, there are several new docs on the docs site to help you get started.)
those math functions are already there. here is an example of my code calling them.. I did not need any import.. this was in the tesla driver if you want to take a look