Skip to content

Commit 7f2a748

Browse files
committed
perf: stop using fma
1 parent 4a095ac commit 7f2a748

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/_libs/window/aggregations.pyx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from libc.math cimport (
44
fabs,
5-
fma,
65
round,
76
signbit,
87
sqrt,
@@ -549,7 +548,7 @@ cdef void add_skew(float64_t val, int64_t *nobs,
549548
delta_n = delta / n
550549
term1 = delta * delta_n * (n - 1.0)
551550

552-
m3_update = delta_n * fma(term1, n - 2.0, -3.0 * m2[0])
551+
m3_update = delta_n * (term1 * (n - 2.0) - 3.0 * m2[0])
553552
new_m3 = m3[0] + m3_update
554553
if (fabs(m3_update) + fabs(m3[0])) * InvCondTol > fabs(new_m3):
555554
# possible catastrophic cancellation
@@ -594,7 +593,7 @@ cdef void remove_skew(float64_t val, int64_t *nobs,
594593
delta_n = delta / n
595594
term1 = delta_n * delta * (n + 1.0)
596595

597-
m3_update = delta_n * fma(term1, n + 2.0, -3.0 * m2[0])
596+
m3_update = delta_n * (term1 * (n + 2.0) - 3.0 * m2[0])
598597
new_m3 = m3[0] - m3_update
599598

600599
if (fabs(m3_update) + fabs(m3[0])) * InvCondTol > fabs(new_m3):

0 commit comments

Comments
 (0)