apple / swift-numerics

Advanced mathematical types and functions for Swift
Apache License 2.0
1.67k stars 142 forks source link

Conform Quaternion to Elementary Functions #230

Open markuswntr opened 2 years ago

markuswntr commented 2 years ago

This extends https://github.com/apple/swift-numerics/pull/206 and adds the remaining quaternionic elementary functions; making Quaternion fully conform to ElementaryFunctions. 🎉 Most of the functions draw inspiration from the implementation details of the corresponding elementary function on complex numbers. Nonetheless, I greatly appreciate every comment, feedback or suggestions!

Links to new elementary functions:

markuswntr commented 10 months ago

The implementation is still functional, but I am trying to improve the error bounds on log and maybe add an executable to validate the worst-case error (much like the ComplexLog tests), and so I would like to leave it as a draft for now.