slaclab / lcsim

LCSim Java Library
Other
1 stars 5 forks source link

Use FastMath.atan2 instead of Math.atan2 #28

Closed pbutti closed 4 years ago

pbutti commented 4 years ago

FastMath.atan2 is recommended over Math.atan2 as it gives the same result much faster. From jProfiler checks, Math.atan2 is an hotspot due to the large amount of calls. Propose to change to FastMath.atan2. Also suggested by: https://commons.apache.org/proper/commons-math/javadocs/api-3.3/org/apache/commons/math3/util/FastMath.html