Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log(sqrt(x)) = 0.5*log(x) #554

Closed
ekmett opened this issue Sep 19, 2016 · 1 comment
Closed

log(sqrt(x)) = 0.5*log(x) #554

ekmett opened this issue Sep 19, 2016 · 1 comment
Assignees
Milestone

Comments

@ekmett
Copy link

ekmett commented Sep 19, 2016

In

template <typename T, precision P> tquat<T, P> log(tquat<T, P> const& q)

at the end you compute log(QuatLen), which is log(sqrt(...)), but you can shave off the sqrt since you're already computing a logarithm, by exploiting

log(sqrt(x)) = log(pow(x,0.5)) = 0.5*log(x)

No other use of QuatLen is made in the combinator.

@Groovounet Groovounet added this to the GLM 0.9.8 milestone Sep 20, 2016
@Groovounet Groovounet self-assigned this Sep 20, 2016
@Groovounet
Copy link
Member

Thanks for contributing!
Christophe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants