URL:
  <https://savannah.gnu.org/bugs/?63519>

                 Summary: gsl_root_fsolver_set "endpoints do not straddle y=0"
                 Project: GNU Scientific Library
               Submitter: nkr
               Submitted: Tue 13 Dec 2022 01:18:16 PM UTC
                Category: Performance
                Severity: 3 - Normal
        Operating System: Debian Testing
                  Status: None
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 2.7.1


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 13 Dec 2022 01:18:16 PM UTC By: Navi <nkr>
Hello,

Root Bracketing Algorithms (bisection, brent, and falsepos) expect that the
sign of f(a) and f(b) be different so that the endpoints do straddle f(x)=0.
gsl_root_fsolver_set returns GSL_SUCCESS when the supplied interval is good
and throws GSL_ERROR ("endpoints do not straddle y=0", GSL_EINVAL);
otherwise.

I've a particular case where I've to split up my complete domain into
subdomains to avoid singularities. My root is an angle and I've to avoid 0,
90, 180, and 360 degrees. So I split my domain into 4 quadrants; only one of
which will be a valid interval. Now I could either test each interval before
calling gsl_root_fsolver_set or redefine gsl's error handler to not "abort()".
Option 1 is a performance issue for me because f(x) is a costly function. On
the one hand gsl_root_fsolver_set expects the user to check beforehand that
the end points do straddle y=0. But it checks again internally the validity of
the same condition. Option 2 is what I do now.

If gsl_root_fsolver_set returns GSL_EINVAL instead of throwing an error it
would give the user an option to handle the error (without redefining gsl's
error handler) and also avoid checking the "endpoints do straddle y=0"
condition twice.

Regards,
Navi







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63519>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/


Reply via email to