Skip to content

Instantly share code, notes, and snippets.

@wadejensen
Created November 8, 2017 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wadejensen/69a6aa949c5514c340dc58a9c41760a1 to your computer and use it in GitHub Desktop.
Save wadejensen/69a6aa949c5514c340dc58a9c41760a1 to your computer and use it in GitHub Desktop.
Trying to work out why line 5 is super expensive
// ...
var alpha = atan2(sLambda * cEpsilon, cLambda)
// This calculation is 100X more expensive than trig functions on NDArray of same size
val temp = alpha.cond( Conditions.lessThan(0.0) ) * (2 * math.Pi)
val alpha2 = alpha + temp
val delta = asin(sLambda * sEpsilon)
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment