-
Notifications
You must be signed in to change notification settings - Fork 13
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
Coordinate Transformations #51
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #51 +/- ##
=======================================
Coverage 90.47% 90.47%
=======================================
Files 3 3
Lines 126 126
=======================================
Hits 114 114
Misses 12 12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Benchmarks for coordinate transformationsSetup: using BenchmarkTools
lon = randn() * pi + pi
lat = randn() * pi
function maxerr(func, invfunc)
test_lon = range(0, pi, length=100)
test_lat = range(-pi, pi, length=100)
test_big_lon = range(big(0), big(pi), length=100)
test_big_lat = range(-big(pi), big(pi), length=100)
res = func.(test_lon, test_lat)
res_big = func.(test_big_lon, test_big_lat)
delt = mapreduce((a,b) -> sum(a .- b), max, res, res_big)
invres = invfunc.(res)
invres_big = invfunc.(res_big)
invdelt = mapreduce((a,b) -> sum(a .- b), max, invres, invres_big)
return delt, invdelt
end
|
cc @giordano any comments on these results? If you have suggestions for testing differently I'm happy to try them, too. |
The problem of sqrt+squares is that it under/overflows:
However, as you can see, |
I think a 20 nanosecond hit is worth the accuracy, personally. |
This PR addresses extra comments from #48
Right now I am doing timing/accuracy tests for
coords2cart
andcart2coords
to assesssqrt
vshypot
vs CoordinateTransformations.jl