FLOP types¶
This page provides detailed information about how each floating-point
operation (FLOP) type is counted and analyzed in the counted-float package.
All math.* entries below assume an active FlopCountingContext (outside
one, the math module is not instrumented — see
Math patching semantics). For each flop type, you will
find:
- Relevant scalar instructions for ARM (v8+) and x86 (SSE2+)
- Python operations that are counted for this flop type
- Python operations that are not counted for this flop type
The rules deciding how each type is priced (compiled-port lens, real-call lens, and the documented fallback) are stated in Cost-model rules.
Coverage at a glance¶
| Python operation | Counts as | Mechanism | Weight source | Stays CountedFloat? |
|---|---|---|---|---|
x + y, x - y, x * y |
ADD, SUB, MUL (sign-exact identity constants fold: * 1.0 / - 0.0 / + (-0.0) → nothing, * -1.0 / (-0.0) - x → MINUS) |
operator | ISA | yes |
x / y |
DIV (MUL for a power-of-two constant divisor — the exact reciprocal fold; MINUS for x / -1.0; nothing for x / 1.0) |
operator | ISA | yes |
x // y |
DIV + RND (the division step folds like / for constant divisors) |
operator (decomposed) | ISA | yes |
x % y |
DIV + RND + MUL + SUB (the division step folds like / for constant divisors; a ±1.0 divisor folds the multiply step too — away for 1.0, to MINUS for -1.0) |
operator (decomposed) | ISA | yes |
divmod(x, y) |
DIV + RND + MUL + SUB (folds like %, division step and multiply step alike) |
operator (decomposed) | ISA | yes (both) |
-x |
MINUS |
operator | ISA | yes |
+x |
(nothing) | operator | — | yes |
abs(x), math.fabs(x) |
ABS |
operator / patch | ISA | yes |
x == y, x < y, … |
COMP |
operator | ISA | returns bool |
min(x, y, ...), max(x, y, ...) |
COMP per comparison |
operator | ISA | returns the winning operand — plain when a plain constant wins; re-wrap with CountedFloat(...) to keep counting |
round(x, 0) |
RND |
operator | ISA | yes (float) |
round(x, n), n != 0 |
MUL + RND + DIV |
operator (decomposed) | ISA | yes (float) |
round(x), int(x), math.floor/ceil/trunc |
F2I |
operator | ISA | returns int |
CountedFloat(int) |
I2F |
constructor | ISA | yes |
x ** y, math.pow(x, y) |
POW (or cheaper via constant strength reduction — MULs, SQRT, DIV, EXP2, EXP10) |
operator / patch | benchmarked | yes |
math.fma(x, y, z) (3.13+) |
FMA (or ADD when both multiplicands are constant; nothing when their product is exactly -0.0) |
patch | ISA | yes |
math.sqrt(x) |
SQRT |
patch | ISA | yes |
math.cbrt(x) |
CBRT |
patch | benchmarked | yes |
math.exp(x), math.exp2(x), 2 ** x |
EXP, EXP2 |
patch / operator | benchmarked | yes |
math.log(x[, base]) |
LOG (or LOG2/LOG10; decomposes for other bases) |
patch | benchmarked | yes |
math.sin/cos/tan(x) |
SIN, COS, TAN |
patch | benchmarked | yes |
math.asin/acos/atan(x) |
ASIN, ACOS, ATAN |
patch | benchmarked | yes |
math.atan2(y, x) |
ATAN2 |
patch | benchmarked | yes |
math.hypot(x, y, ...) |
HYPOT + (n−2) HYPOT_XARG (1 arg → ABS) |
patch | benchmarked | yes |
math.expm1(x), math.log1p(x) |
EXPM1, LOG1P |
patch | benchmarked | yes |
math.fmod(x, y) |
FMOD |
patch | benchmarked | yes |
math.remainder(x, y) |
REMAINDER |
patch | benchmarked | yes |
math.sinh/cosh/tanh(x), asinh/acosh/atanh(x) |
SINH, COSH, TANH, ASINH, ACOSH, ATANH |
patch | benchmarked | yes |
math.gamma/lgamma(x) |
GAMMA, LGAMMA |
patch | benchmarked | yes |
math.erf/erfc(x) |
ERF, ERFC |
patch | benchmarked | yes |
math.copysign(x, y) |
COPYSIGN |
patch | benchmarked | yes |
math.fmax(x, y), math.fmin(x, y) (3.15+) |
COMP (the NaN-quieting guard is unpriced) |
patch | ISA | yes — unlike the builtins, whichever operand wins |
math.degrees(x), math.radians(x) |
MUL (decomposed) |
patch | — | yes |
math.dist(p, q) |
DIST + (n−2) DIST_XARG (1-D → SUB + ABS) |
patch | benchmarked | yes |
math.prod(xs) |
(n−1) MUL for n elements, n when start is counted or differs from 1 (decomposed) |
patch | — | yes |
math.fsum(xs) |
(n−1) ADD (decomposed; compensation machinery not modeled) |
patch | — | yes |
math.sumprod(p, q) (3.12+) |
SUMPROD + (n−2) SUMPROD_XELEM |
patch | benchmarked | yes |
numpy.* and other non-stdlib math |
(uncounted) | — | — | no |
- Mechanism — operator: a
CountedFloatdunder, counted everywhere. patch: amath.*function, counted only inside aFlopCountingContext(see Math patching semantics). decomposed: no dedicatedFlopType— counts as a composition of existing types. - Weight source — ISA: backed by a real hardware instruction (spec-sheet latency + benchmarks). benchmarked: a libm-level op with no corresponding instruction, so its weight comes from benchmarks alone.
Decomposed operations¶
//, %, and divmod() have no dedicated FlopType: a compiled port emits
each as a sequence of primitive operations, and that sequence is what gets
counted. Python's ///% use floored semantics, so ⌊·⌋ below is a
float→float round (RND), not an F2I:
x // y→DIV + RND— divide, then floor the quotient.x % y→DIV + RND + MUL + SUB— the floored remainderr = x − y·⌊x/y⌋.divmod(x, y)→DIV + RND + MUL + SUB— quotient and remainder share theDIV + RND, so it costs the same as a lone%.
For a constant divisor the division step folds like a bare /, and a ±1.0 divisor also
folds the y·⌊x/y⌋ multiply — the divisor is that multiply's constant factor, so the
identity folds apply to it: away for 1.0, MINUS for -1.0.
round(x, n) with a nonzero digit count decomposes the same way:
round(x, n),n != 0→MUL + RND + DIV— scale into the digit position, round, scale back. The unscale is a true divide (the scale factor is a power of ten, whose reciprocal is not exact). Stated gap: CPython itself computes this via correctly-rounded decimal conversion, whose input-dependent cost the port price knowingly omits.round(x, 0)needs no scaling and counts a loneRND.
Note the % operator (floored) is distinct from math.fmod (the truncated C
remainder, which has its own FlopType.FMOD). math.log(x, base) also
decomposes for bases other than 2/10 — see FlopType.LOG below.
FlopType.ABS (abs(x))¶
- Relevant CPU instructions
- ARM:
FABS - x86:
ANDPD
- ARM:
- Counted Python operations:
abs(x)andmath.fabs(x)wherexis aCountedFloat(both map to the sameFABS/ANDPDinstruction); one ABS insidemath.isinf/math.isfinite(the classifier'sfabs-then-compare), one insidemath.isnormal/math.issubnormal(the magnitude their range test takes once) and three insidemath.isclose's core - Not counted:
numpy.abs,numpy.fabs, complex abs, abs on non-CountedFloat - Weight measurement: the machine code behind the
ABSweight
FlopType.MINUS (-x)¶
- Relevant CPU instructions
- ARM:
FNEG - x86:
XORPD
- ARM:
- Counted Python operations: Unary minus (
-x) forCountedFloat - Not counted: Negation on non-CountedFloat, numpy negation
- Weight measurement: the machine code behind the
MINUSweight
FlopType.COPYSIGN (copysign(x,y))¶
- Relevant CPU instructions
- ARM:
BIT(bitwise insert with a sign mask — a single instruction) - x86:
ANDPD+ANDPD+ORPD(no dedicated instruction: clear the sign ofx, isolate the sign ofy, merge)
- ARM:
- Counted Python operations:
math.copysign(x, y)wherexoryis aCountedFloat(and only there —math.signbit, which reads the same bit, counts COMP instead: see the decomposed operations) - Not counted: copysign on non-CountedFloat, numpy copysign
- Note: same sign-bit instruction class as ABS and MINUS, but 1–3 ops depending on architecture — which is why it is measured as its own benchmarked flop type rather than assumed equal to ABS. Its weight comes from benchmarks only (like the libm functions); vendor latency tables have no row for it.
- Weight measurement: the machine code behind the
COPYSIGNweight
FlopType.COMP (x<=y, x>y, x==y, x==0.0, ...)¶
- Relevant CPU instructions
- ARM:
FCMP - x86:
(U)COMISD
- ARM:
- Counted Python operations:
x == y,x != y,x <= y, ... andmin(x,y),max(x,y)forCountedFloat; the selectionsmath.fmax(x,y)/math.fmin(x,y)(the compare-and-select a port emits); the float classifiers —math.isnan(the self-compare a port emits), one COMP insidemath.isinf/math.isfinite, two insidemath.isnormal/math.issubnormal(their two range bounds), one formath.signbit(the sole charge: its question has no FP form to decompose), three insidemath.isclose's core, andis_integer()'s compare - Not counted: Comparisons on non-CountedFloat, numpy comparisons, and
truthiness (
bool(x),if x:,assert x) — a deliberate, labeled exception. The interpreter inserts the test implicitly at everyif/while/and/or/not/assertwith no opt-out, andpython -Oelidesassertentirely, so a truthiness count would price interpreter bookkeeping and vary with interpreter flags — no port-faithful count does either. Write an algorithmic zero-test asx != 0.0to have it counted - Note: the builtin
min/maxreturn the winning operand object, not abool— with mixed counted/plain arguments the winner may be the plain constant, which ends countedness; see known limitations.math.fmax/math.fminare not affected: they build a fresh result, which the patch wraps, so countedness survives whichever operand wins - Weight measurement: the machine code behind the
COMPweight
FlopType.RND (round)¶
- Relevant CPU instructions
- ARM:
FRINT - x86:
ROUNDSD
- ARM:
- Counted Python operations:
round(x, 0)forCountedFloat(returns float), plus the round step inside the decomposed operations —round(x, n)with nonzeron(MUL + RND + DIV) and the floor ofx // y/x % y/divmod - Not counted:
numpy.round, rounding on non-CountedFloat - Weight measurement: the machine code behind the
RNDweight
FlopType.F2I (float->int)¶
- Relevant CPU instructions
- ARM:
FCVTZS - x86:
CVTSD2SI
- ARM:
- Counted Python operations:
int(x),math.floor(x),math.ceil(x),math.trunc(x),round(x)forCountedFloat(returns int) - Not counted: Conversions on non-CountedFloat, numpy conversions
FlopType.I2F (int->float)¶
- Relevant CPU instructions
- ARM:
SCVTF - x86:
CVTSI2SD
- ARM:
- Counted Python operations: Construction of
CountedFloatfrom an int, e.g.CountedFloat(3)— the way to opt a genuine runtime integer into the counting model - Not counted:
float(n); anintoperand in arithmetic, comparisons, or**(e.g.x + 3,3 * x,x < 2,x**3) — anintoperand is a compile-time constant, folded to a float literal by a compiled port, so it adds no conversion (see Counting FLOPs)
FlopType.ADD (x+y)¶
- Relevant CPU instructions
- ARM:
FADD - x86:
ADDSD
- ARM:
- Counted Python operations:
x + yory + xforCountedFloat - Not counted: Addition on non-CountedFloat, numpy addition
- Weight measurement: the machine code behind the
ADDweight
FlopType.SUB (x-y)¶
- Relevant CPU instructions
- ARM:
FSUB - x86:
SUBSD
- ARM:
- Counted Python operations:
x - yory - xforCountedFloat - Not counted: Subtraction on non-CountedFloat, numpy subtraction
- Weight measurement: the machine code behind the
SUBweight
FlopType.MUL (x*y)¶
- Relevant CPU instructions
- ARM:
FMUL - x86:
MULSD
- ARM:
- Counted Python operations:
x * yory * xforCountedFloat - Not counted: Multiplication on non-CountedFloat, numpy multiplication
- Weight measurement: the machine code behind the
MULweight
FlopType.DIV (x/y)¶
- Relevant CPU instructions
- ARM:
FDIV - x86:
DIVSD
- ARM:
- Counted Python operations:
x / yory / xforCountedFloat— except division by a power-of-two constant divisor of either sign with a finite reciprocal, which countsMUL: for exactly those divisorsx * (1/c)is bit-identical tox / c, so a compiled port applies the reciprocal fold.x / 1.0counts nothing at all (it folds away entirely, mirroringx ** 1) - Not counted: Division on non-CountedFloat, numpy division
- Weight measurement: the machine code behind the
DIVweight
FlopType.FMA (x*y+z)¶
- Relevant CPU instructions
- ARM:
FMADD - x86:
VFMADD213SD
- ARM:
- Counted Python operations:
math.fma(x, y, z)(Python 3.13+) — counted when any operand is aCountedFloat, as one fused multiply-add: a single instruction with a single rounding - Constant multiplicands decompose: when both
xandyare constants their product folds at compile time, leaving a compiled port with a bare add, so that counts ADD rather than FMA — and a collapsed product of exactly-0.0folds the add away too (z + (-0.0)iszfor everyz), counting nothing. A survivingfmagets no reduction by constant value: the explicit call stays fused by the author-boundary pin — written fused stays fused, even where a bit-exact cheaper respelling exists (see the counting model) - Not counted:
math.fmaon plain floats only;a*b + cwritten with operators, which counts MUL + ADD because the interpreter cannot observe the fusion (see Known limitations) - Weight measurement: the machine code behind the
FMAweight
FlopType.SQRT (sqrt(x))¶
- Relevant CPU instructions
- ARM:
FSQRT - x86:
SQRTSD
- ARM:
- Counted Python operations:
math.sqrt(x)forCountedFloat - Not counted:
numpy.sqrt, sqrt on non-CountedFloat - Weight measurement: the machine code behind the
SQRTweight
FlopType.CBRT (cbrt(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.cbrt(x)forCountedFloat - Not counted:
numpy.cbrt, cbrt on non-CountedFloat - Weight measurement: the machine code behind the
CBRTweight
FlopType.EXP (e^x)¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.exp(x)forCountedFloat - Not counted:
math.exp(x)on non-CountedFloat,numpy.exp,math.expm1,math.e ** x - Note:
math.e ** xcounts POW, not EXP —math.eis not e (no float is; e is irrational), sopow(math.e, x)andexp(x)compute different functions, and neither the bit-exact compiler stage nor the same-computation author stage of the cost model admits the rewrite. Contrastmath.log(x, math.e), whose fold rides a1/log(base)multiplier that evaluates to exactly 1.0 (seeFlopType.LOG) - Weight measurement: the machine code behind the
EXPweight
FlopType.EXP2 (2^x)¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
2 ** x,pow(2, x)ormath.exp2(x)forCountedFloat - Not counted:
exp2on non-CountedFloat,numpy.exp2 - Weight measurement: the machine code behind the
EXP2weight
FlopType.EXP10 (10^x)¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
10 ** x,pow(10, x)forCountedFloat - Not counted:
10 ** xon non-CountedFloat - Weight measurement: the machine code behind the
EXP10weight
FlopType.LOG (log(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.log(x)forCountedFloat;math.log(x, base)forCountedFloatdecomposes per the constant-folding convention (constant base 2/10 -> LOG2/LOG10; other constant base -> LOG+MUL, where the multiply itself identity-folds when1/log(base)is exactly ±1.0 — e.g. basemath.e; CountedFloat base -> LOG per counted operand + DIV) - Not counted:
numpy.log, log on non-CountedFloat - Weight measurement: the machine code behind the
LOGweight
FlopType.LOG2 (log2(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.log2(x)forCountedFloat;math.log(x, 2)(int base) forCountedFloat - Not counted:
numpy.log2, log2 on non-CountedFloat - Weight measurement: the machine code behind the
LOG2weight
FlopType.LOG10 (log10(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.log10(x)forCountedFloat;math.log(x, 10)(int base) forCountedFloat - Not counted:
numpy.log10, log10 on non-CountedFloat - Weight measurement: the machine code behind the
LOG10weight
FlopType.POW (x^y)¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
x ** y,pow(x, y)forCountedFloat; constant exponents/bases strength-reduce per the constant-folding convention (see the counting-model page):x**0.5-> SQRT,x**-1-> DIV, integer exponents 2 <= |n| <= 16 -> their multiply chain, base 2/10 -> EXP2/EXP10 - Not counted:
powon non-CountedFloat,numpy.pow; a negative base under a fractional exponent with either operand counted, whose result is a plaincomplex— it leaves the real-float domain the model prices, so nothing is counted and contagion ends - Weight measurement: the machine code behind the
POWweight
FlopType.SIN (sin(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.sin(x)forCountedFloat - Not counted:
sinon non-CountedFloat,numpy.sin - Weight measurement: the machine code behind the
SINweight
FlopType.COS (cos(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.cos(x)forCountedFloat - Not counted:
coson non-CountedFloat,numpy.cos - Weight measurement: the machine code behind the
COSweight
FlopType.TAN (tan(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.tan(x)forCountedFloat - Not counted:
tanon non-CountedFloat,numpy.tan - Weight measurement: the machine code behind the
TANweight
FlopType.ASIN (asin(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.asin(x)forCountedFloat - Not counted:
asinon non-CountedFloat,numpy.arcsin - Weight measurement: the machine code behind the
ASINweight
FlopType.ACOS (acos(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.acos(x)forCountedFloat - Not counted:
acoson non-CountedFloat,numpy.arccos - Weight measurement: the machine code behind the
ACOSweight
FlopType.ATAN (atan(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.atan(x)forCountedFloat - Not counted:
atanon non-CountedFloat,numpy.arctan - Weight measurement: the machine code behind the
ATANweight
FlopType.ATAN2 (atan2(y, x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.atan2(y, x)forCountedFloat— counted when either operand is aCountedFloat - Not counted:
atan2on plain floats only,numpy.arctan2 - Weight measurement: the machine code behind the
ATAN2weight
FlopType.HYPOT (hypot(x, y, ...))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.hypot(...)forCountedFloat— counted once per call when any coordinate is aCountedFloat; coordinates beyond the second each add aHYPOT_XARG, and a 1-argument call countsABSinstead (it computes|x|) - Not counted:
hypoton plain floats only,numpy.hypot - Weight measurement: the machine code behind the
HYPOTweight
FlopType.HYPOT_XARG (hypot(x, y, z, ...))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations: one per coordinate beyond the second of a
math.hypotcall: an n-ary call countsHYPOT+ (n−2)HYPOT_XARG - Not counted: 2-argument calls (they cost the base
HYPOTalone) - Note: the per-extra-coordinate slope of the overflow-safe scaled
algorithm
math.hypotexecutes — far cheaper than a whole extra call, since the extra coordinate's squares overlap the shared scaling andsqrt - Weight measurement: the machine code behind the
HYPOT_XARGweight
FlopType.DIST (dist(p, q))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.dist(p, q)forCountedFloat— counted once per call when any coordinate is aCountedFloat; coordinates beyond the second each add aDIST_XARG, and a 1-D call countsSUB + ABSinstead: the coordinate difference through the same single-coordinate shortcut as 1-argumenthypot - Not counted:
diston plain floats only, numpy norms/distances - Note: the 2-D base price of the overflow-safe algorithm
math.distexecutes; it sits aboveHYPOTby the per-coordinate subtraction work its offset carries - Weight measurement: the machine code behind the
DISTweight
FlopType.DIST_XARG (dist(p, q), 3+ dimensions)¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations: one per dimension beyond the second of a
math.distcall: an n-dimensional call countsDIST+ (n−2)DIST_XARG - Not counted: 2-dimensional calls (they cost the base
DISTalone) and 1-dimensional calls (SUB + ABS) - Weight measurement: the machine code behind the
DIST_XARGweight
FlopType.SUMPROD (sumprod(p,q))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.sumprod(p, q)(Python 3.12+) forCountedFloat— counted once per call when any element is aCountedFloat; elements beyond the second each add aSUMPROD_XELEM - Not counted:
sumprodon plain floats only,numpy.dotand friends - Note: the 2-element base price (close-out included) of the
extended-precision (TripleLength) accumulation
math.sumprodexecutes; counted inputs are unboxed to plain floats before delegating, so the exact-float production algorithm runs — aCountedFloatelement would otherwise silently reroute the call to a naive object path - Weight measurement: the machine code behind the
SUMPRODweight
FlopType.SUMPROD_XELEM (sumprod(p,q), 3+ elements)¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations: one per element beyond the second of a
math.sumprodcall: an n-element call countsSUMPROD+ (n−2)SUMPROD_XELEM - Not counted: 1- and 2-element calls (they cost the base
SUMPRODalone) - Note: far below the per-element cost a decomposed compensation chain would suggest — the algorithm's lanes overlap, and the measured slope captures that overlap
- Weight measurement: the machine code behind the
SUMPROD_XELEMweight
FlopType.EXPM1 (expm1(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.expm1(x)forCountedFloat - Not counted:
expm1on non-CountedFloat,numpy.expm1,math.exp(x) - 1 - Weight measurement: the machine code behind the
EXPM1weight
FlopType.LOG1P (log1p(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.log1p(x)forCountedFloat - Not counted:
log1pon non-CountedFloat,numpy.log1p,math.log(1 + x) - Weight measurement: the machine code behind the
LOG1Pweight
FlopType.FMOD (fmod(x, y))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.fmod(x, y)forCountedFloat— counted when either operand is aCountedFloat(the C-library truncated remainder; distinct from the%operator's floored remainder) - Not counted:
fmodon plain floats only,numpy.fmod - Weight measurement: the machine code behind the
FMODweight
FlopType.REMAINDER (remainder(x, y))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.remainder(x, y)forCountedFloat— counted when either operand is aCountedFloat(the IEEE 754 round-to-nearest remainder; distinct from bothmath.fmodand the%operator) - Not counted:
remainderon plain floats only,numpy.remainder(which computes the floored%semantics, not this function) - Weight measurement: the machine code behind the
REMAINDERweight
FlopType.SINH (sinh(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.sinh(x)forCountedFloat - Not counted:
sinhon non-CountedFloat,numpy.sinh - Weight measurement: the machine code behind the
SINHweight
FlopType.COSH (cosh(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.cosh(x)forCountedFloat - Not counted:
coshon non-CountedFloat,numpy.cosh - Weight measurement: the machine code behind the
COSHweight
FlopType.TANH (tanh(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.tanh(x)forCountedFloat - Not counted:
tanhon non-CountedFloat,numpy.tanh - Weight measurement: the machine code behind the
TANHweight
FlopType.ASINH (asinh(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.asinh(x)forCountedFloat - Not counted:
asinhon non-CountedFloat,numpy.arcsinh - Weight measurement: the machine code behind the
ASINHweight
FlopType.ACOSH (acosh(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.acosh(x)forCountedFloat - Not counted:
acoshon non-CountedFloat,numpy.arccosh - Weight measurement: the machine code behind the
ACOSHweight
FlopType.ATANH (atanh(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.atanh(x)forCountedFloat - Not counted:
atanhon non-CountedFloat,numpy.arctanh - Weight measurement: the machine code behind the
ATANHweight
FlopType.GAMMA (gamma(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.gamma(x)forCountedFloat - Not counted: gamma on non-CountedFloat,
scipy.special.gamma - Weight measurement: the machine code behind the
GAMMAweight
FlopType.LGAMMA (lgamma(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.lgamma(x)forCountedFloat - Not counted: lgamma on non-CountedFloat,
scipy.special.gammaln,math.log(math.gamma(x))(which counts GAMMA + LOG) - Weight measurement: the machine code behind the
LGAMMAweight
FlopType.ERF (erf(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.erf(x)forCountedFloat - Not counted: erf on non-CountedFloat,
scipy.special.erf - Weight measurement: the machine code behind the
ERFweight
FlopType.ERFC (erfc(x))¶
- Relevant CPU instructions
- ARM: (software)
- x86: (software)
- Counted Python operations:
math.erfc(x)forCountedFloat - Not counted: erfc on non-CountedFloat,
scipy.special.erfc,1 - math.erf(x)(which counts ERF + SUB) - Weight measurement: the machine code behind the
ERFCweight