diff options
| author | Charles Karney <charles.karney@sri.com> | 2020-10-26 16:06:19 -0400 |
|---|---|---|
| committer | Charles Karney <charles.karney@sri.com> | 2020-10-26 16:06:19 -0400 |
| commit | 1081e496a0fc7e45c6eb4703b0fc402bf2a9e945 (patch) | |
| tree | 46c57750e8f94ab20a5b61403935723ee3d50417 /src/projections | |
| parent | 6c2363e88f8eb86e1331b3dc5f05897436ad9c43 (diff) | |
| download | PROJ-1081e496a0fc7e45c6eb4703b0fc402bf2a9e945.tar.gz PROJ-1081e496a0fc7e45c6eb4703b0fc402bf2a9e945.zip | |
lcc.cpp: fix abs -> fabs
Also some corrected information...
Timing UPDATED
--------------
Sorry the previous timing data was wrong. Here are corrected values..
Here's what I get with g++ -O3 on two Linux machines with recent
versions of g++. As always, you should take these with a grain of
salt. Times per call in ns = nanoseconds.
Fedora 31 Ubuntu 18
g++-9.3.1 g++-7.5.0
fwd inv fwd inv
old merc 207 461 217 522
new merc 228 457 168 410
etmerc 212 196 174 147
The new forward method is the 10% slower (resp 20% faster) on Fedora
31 (resp Ubuntu 18). The new inverse method is the same speed (resp
20% faster) on Fedora 31 (resp Ubuntu 18).
Roughly speaking the speed comparison is a wash. Maybe we should pay
attention more to the Fedora 31 results since these are with a newer
version of the compiler. I would still make the argument that a 20%
time penalty (which in a full PROJ pipeline would probably be no more
than a 5% penalty) would be a worthwhile price to pay for a more
robust implementation of the projection.
Diffstat (limited to 'src/projections')
| -rw-r--r-- | src/projections/lcc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/projections/lcc.cpp b/src/projections/lcc.cpp index b83b8072..46378ce4 100644 --- a/src/projections/lcc.cpp +++ b/src/projections/lcc.cpp @@ -106,7 +106,7 @@ PJ *PROJECTION(lcc) { double ml1, m1; m1 = pj_msfn(sinphi, cosphi, P->es); - if( abs(Q->phi1) == M_HALFPI ) { + if( fabs(Q->phi1) == M_HALFPI ) { return pj_default_destructor(P, PJD_ERR_LAT_1_OR_2_ZERO_OR_90); } ml1 = pj_tsfn(Q->phi1, sinphi, P->e); @@ -117,7 +117,7 @@ PJ *PROJECTION(lcc) { // Not quite, but es is very close to 1... return pj_default_destructor(P, PJD_ERR_INVALID_ECCENTRICITY); } - if( abs(Q->phi2) == M_HALFPI ) { + if( fabs(Q->phi2) == M_HALFPI ) { return pj_default_destructor(P, PJD_ERR_LAT_1_OR_2_ZERO_OR_90); } const double ml2 = pj_tsfn(Q->phi2, sinphi, P->e); |
