Repository: sympy/sympy

Issue:
Different `.evalf()` precisions with `x` and `FiniteSet(x)`
The working precision must be different when working with expressions and sets of expressions. See the following:

```python
from sympy import *

x = pi - 3.14159265358979
print(x.evalf())  # more correct
print(FiniteSet(x).evalf())  # less correct
```
Giving
```python
3.23108914886517e-15
FiniteSet(3.10862446895044e-15)
```
That is almost a 5% error which is not good. The "correct" answer is `x.evalf()`. The `FiniteSet` version must be using a reduced precision.

Is this possible to be fixed? I'm not that familiar with the `.evalf()` source.

Is there any way to manually change this in the meantime? I don't want to write `FiniteSet(*[arg.evalf() for args in A])`.

Discussion:

Patch:
diff --git a/sympy/sets/sets.py b/sympy/sets/sets.py
index dc1035fe62..511b52e299 100644
--- a/sympy/sets/sets.py
+++ b/sympy/sets/sets.py
@@ -8,7 +8,7 @@
 from sympy.core.containers import Tuple
 from sympy.core.decorators import (deprecated, sympify_method_args,
     sympify_return)
-from sympy.core.evalf import EvalfMixin
+from sympy.core.evalf import EvalfMixin, prec_to_dps
 from sympy.core.parameters import global_parameters
 from sympy.core.expr import Expr
 from sympy.core.logic import (FuzzyBool, fuzzy_bool, fuzzy_or, fuzzy_and,
@@ -1884,7 +1884,7 @@ def compare(self, other):
         return (hash(self) - hash(other))
 
     def _eval_evalf(self, prec):
-        return FiniteSet(*[elem._evalf(prec) for elem in self])
+        return FiniteSet(*[elem.evalf(n=prec_to_dps(prec)) for elem in self])
 
     @property
     def _sorted_args(self):


Test patch:
diff --git a/sympy/sets/tests/test_sets.py b/sympy/sets/tests/test_sets.py
index 669e5d8454..d29a046072 100644
--- a/sympy/sets/tests/test_sets.py
+++ b/sympy/sets/tests/test_sets.py
@@ -1596,3 +1596,8 @@ def test_issue_20089():
     C = FiniteSet(FiniteSet(1, 2), FiniteSet(1), 1, 2)
     assert A.issubset(C)
     assert B.issubset(C)
+
+def test_issue_20379():
+    #https://github.com/sympy/sympy/issues/20379
+    x = pi - 3.14159265358979
+    assert FiniteSet(x).evalf(2) == FiniteSet(Float('3.23108914886517e-15', 2))