patr-schm / TinyAD

Automatic Differentiation in Geometry Processing Made Simple
MIT License
371 stars 17 forks source link

Add new math functions #1

Closed DavidJourdan closed 2 years ago

DavidJourdan commented 2 years ago

Thank you very much for releasing this library! As someone who spent endless hours deriving hessian formulas by hand I can say this is clearly a big help :)

I've added some math functions (clamp, log2, log10) that were missing from the library, they are listed as common math functions here: https://en.cppreference.com/w/cpp/numeric/math I wrote some tests for each function, but unfortunately I didn't find a way to build the tests (there's an error with StackLowerThanAddress function on gtest-1.10.0) so I could not check that the functions pass the tests unfortunately.

Anyways I've used them in a personal project and they seemed to work fine so I hope this helps

patr-schm commented 2 years ago

Thanks a lot for the contribution! I'm very happy you're finding TinyAD useful :)

I made sure the new tests compile and pass in our internal CI.