jainankitk commented on code in PR #14516: URL: https://github.com/apache/lucene/pull/14516#discussion_r2056713597
########## lucene/core/src/java/org/apache/lucene/util/SloppyMath.java: ########## @@ -178,6 +178,30 @@ public static double asin(double a) { } } + // some sloppyish stuff, do we really need this to be done in a sloppy way? + // unless it is performance sensitive, we should try to remove. + // This is performance sensitive, check SloppySinBenchmark and RectangleBenchmark + private static final double PIO2 = Math.PI / 2D; + + /** + * Returns the trigonometric sine of an angle converted as a cos operation. + * + * <p>Note that this is not quite right... e.g. sin(0) != 0 + * + * <p>Special cases: + * + * <ul> + * <li>If the argument is {@code NaN} or an infinity, then the result is {@code NaN}. + * </ul> + * + * @param a an angle, in radians. + * @return the sine of the argument. + * @see Math#sin(double) + */ + public static double sin(double a) { Review Comment: > I'm not familiar with what the Rectangle code is doing here: I don't tend to think about sin() being associated with Rectanges... `sin()` is used for calculating and adjusting the longitude range of a circle's bounding Rectangle based on the latitude -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org