From b01cda67cf5592e3b87be1c58515fc8c627f2e4a Mon Sep 17 00:00:00 2001 From: mmatera Date: Mon, 21 Nov 2022 18:50:30 -0300 Subject: [PATCH] to_python(n_evaluation=True)-> eval_N(...).to_python() --- mathics/algorithm/optimizers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mathics/algorithm/optimizers.py b/mathics/algorithm/optimizers.py index 6ad599e94..c23e962a4 100644 --- a/mathics/algorithm/optimizers.py +++ b/mathics/algorithm/optimizers.py @@ -210,8 +210,8 @@ def find_root_secant(f, x0, x, opts, evaluation) -> (Number, bool): return x0, False if not isinstance(f1, Number): return x0, False - f0 = f0.to_python(n_evaluation=True) - f1 = f1.to_python(n_evaluation=True) + f0 = eval_N(f0, evaluation).to_python() + f1 = eval_N(f1, evaluation).to_python() count = 0 while count < maxit: if f0 == f1: @@ -232,7 +232,7 @@ def find_root_secant(f, x0, x, opts, evaluation) -> (Number, bool): ) if not isinstance(f1, Number): return x0, False - f1 = f1.to_python(n_evaluation=True) + f1 = eval_N(f1, evaluation).to_python() continue inv_deltaf = from_python(1.0 / (f1 - f0))