Closed odedstein closed 4 months ago
Our doublearea_instrinsic currently contains
doublearea_instrinsic
dblA = 0.5 * np.sqrt((a+(b+c)) * (c-(a-b)) * (c+(a-b)) * (a+(b-c)))
If the areas are very small, this can NaN. Ideally, we would do
arg = (a+(b+c)) * (c-(a-b)) * (c+(a-b)) * (a+(b-c)) dblA = 0.5 * np.sqrt(np.maximum(arg, 0.))
However, if I make this change, the unit test for reach_for_the_spheres fails. I speculate that it is because the optimization in reach_for_the_spheres does not terminate as early anymore, so it reaches a later stage where it can crash.
reach_for_the_spheres
What should be done about it?
Our
doublearea_instrinsic
currently containsIf the areas are very small, this can NaN. Ideally, we would do
However, if I make this change, the unit test for
reach_for_the_spheres
fails. I speculate that it is because the optimization inreach_for_the_spheres
does not terminate as early anymore, so it reaches a later stage where it can crash.What should be done about it?