@@ -1463,6 +1463,9 @@ public abstract static class AcoshNode extends MathDoubleUnaryBuiltinNode {
1463
1463
private static final double TWO_POW_P28 = 0x1.0p28 ;
1464
1464
private static final double LN_2 = 6.93147180559945286227e-01 ;
1465
1465
1466
+ private final ConditionProfile largeProfile = ConditionProfile .createBinaryProfile ();
1467
+ private final ConditionProfile smallProfile = ConditionProfile .createBinaryProfile ();
1468
+
1466
1469
@ Specialization
1467
1470
@ TruffleBoundary
1468
1471
@ Override
@@ -1482,10 +1485,10 @@ public double doPI(PInt value) {
1482
1485
@ Override
1483
1486
public double count (double value ) {
1484
1487
checkMathDomainError (value < 1 );
1485
- if (value >= TWO_POW_P28 ) {
1488
+ if (largeProfile . profile ( value >= TWO_POW_P28 ) ) {
1486
1489
return Math .log (value ) + LN_2 ;
1487
1490
}
1488
- if (value <= 2.0 ) {
1491
+ if (smallProfile . profile ( value <= 2.0 ) ) {
1489
1492
double t = value - 1.0 ;
1490
1493
return Math .log1p (t + Math .sqrt (2.0 * t + t * t ));
1491
1494
}
@@ -1584,15 +1587,18 @@ public abstract static class AtanhNode extends MathDoubleUnaryBuiltinNode {
1584
1587
1585
1588
private static final double TWO_POW_M28 = 0x1.0p-28 ;
1586
1589
1590
+ private final ConditionProfile closeToZeroProfile = ConditionProfile .createBinaryProfile ();
1591
+ private final ConditionProfile lessThanHalfProfile = ConditionProfile .createBinaryProfile ();
1592
+
1587
1593
@ Override
1588
1594
public double count (double value ) {
1589
1595
double abs = Math .abs (value );
1590
1596
checkMathDomainError (abs >= 1.0 );
1591
- if (abs < TWO_POW_M28 ) {
1597
+ if (closeToZeroProfile . profile ( abs < TWO_POW_M28 ) ) {
1592
1598
return value ;
1593
1599
}
1594
1600
double t ;
1595
- if (abs < 0.5 ) {
1601
+ if (lessThanHalfProfile . profile ( abs < 0.5 ) ) {
1596
1602
t = abs + abs ;
1597
1603
t = 0.5 * Math .log1p (t + t * abs / (1.0 - abs ));
1598
1604
} else {
0 commit comments