Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the effective precision of an expression
ResourceFunction["EffectivePrecision"][expr] gives the precision of the expression expr, which is a list, equation or similar comprised of numeric subexpressions. |
A list with an explicit machine number has effective precision of MachinePrecision:
In[1]:= | ![]() |
Out[1]= | ![]() |
If a machine number appears in an expression with a head that is neither a list, equation, inequality, nor a numeric function, then the effective precision is infinite:
In[2]:= | ![]() |
Out[2]= | ![]() |
EffectivePrecision will return the lowest precision encountered in a mathematical subexpression:
In[3]:= | ![]() |
Out[3]= | ![]() |
In[4]:= | ![]() |
Out[4]= | ![]() |
MachinePrecision is contagious insofar as it is considered to be lower than any software float precision:
In[5]:= | ![]() |
Out[5]= | ![]() |
EffectivePrecision is intended primarily for mathematical expressions rather than programming language constructs:
In[6]:= | ![]() |
Out[6]= | ![]() |
To find the lowest precision in an arbitrary expression one can use Precision:
In[7]:= | ![]() |
Out[7]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License