We have log, atan2 and pow for floats, but not trigonometric functions like sin, cos and tan.
I think they're common enough to warrant being a native operation. We should have at least one of them, the others could be easily derived (cos(x) = sqrt(1 - sin(x)²), etc)
Describe the solution you'd like
Add at least one of sin, cos and tan functions as a native floating point operation. We could use SHL and SHR tags to implement them for f24 types.
Describe alternatives you've considered
Approximating them using the already present operations. I think it can be done in around ~10-20 interactions each.
Is your feature request related to a problem? Please describe. A request by a Bend user in this issue: https://github.com/HigherOrderCO/Bend/issues/570.
We have log, atan2 and pow for floats, but not trigonometric functions like sin, cos and tan. I think they're common enough to warrant being a native operation. We should have at least one of them, the others could be easily derived (cos(x) = sqrt(1 - sin(x)²), etc)
Describe the solution you'd like Add at least one of
sin
,cos
andtan
functions as a native floating point operation. We could useSHL
andSHR
tags to implement them for f24 types.Describe alternatives you've considered Approximating them using the already present operations. I think it can be done in around ~10-20 interactions each.