[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/eraseme_error dd8fb62 01/10: Postpone considerat
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/eraseme_error dd8fb62 01/10: Postpone consideration of NaN-valued objective functions |
Date: |
Wed, 7 Jul 2021 06:22:13 -0400 (EDT) |
branch: odd/eraseme_error
commit dd8fb6275ef8a8357f561f18897c24dc4170675e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Postpone consideration of NaN-valued objective functions
---
zero_test.cpp | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/zero_test.cpp b/zero_test.cpp
index be1ad58..5bb93f8 100644
--- a/zero_test.cpp
+++ b/zero_test.cpp
@@ -375,9 +375,27 @@ void test_biases()
LMI_TEST(e_more_or_less == e_or_less || e_more_or_less == e_or_more);
// Various tests--see function-template definition.
-
- test_bias(-1.0e100, 4.0e100, -100, e, std::exp(1.0));
- test_bias(-1.0 , 4.0 , 0, e, std::exp(1.0));
+ // However... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ // ...the tests commented out below might seem to "work" only
+ // by accident, as the function doesn't map negative arguments
+ // to any real number. This should be revisited later. It seems
+ // unlikely that Brent actually figured out how to make NaNs work
+ // correctly on IBM 360 hardware, where there is no NaN because
+ // every bit pattern represents a valid floating-point number,
+ // and ln(-1) would presumably have elicited an exception.
+ //
+ // Should lmi_root() check for NaN when it evaluates the objective
+ // function, and just throw if detected? Or should it be able to
+ // find a root anyway?
+ //
+ // A function such as f(x) =
+ // -NaN, x < π
+ // 0.0, x ≡ π
+ // +NaN, x > π
+ // might be considered as a test case.
+
+// test_bias(-1.0e100, 4.0e100, -100, e, std::exp(1.0));
+// test_bias(-1.0 , 4.0 , 0, e, std::exp(1.0));
test_bias( 0.5 , 5.0 , 1, e, std::exp(1.0));
test_bias( 0.5 , 5.0 , 2, e, std::exp(1.0));
test_bias( 0.5 , 5.0 , 3, e, std::exp(1.0));
@@ -386,7 +404,7 @@ void test_biases()
test_bias( 0.5 , 5.0 , 6, e, std::exp(1.0));
test_bias( 0.5 , 5.0 , 7, e, std::exp(1.0));
test_bias( 0.5 , 5.0 , 8, e, std::exp(1.0));
- test_bias(-1.0 , 4.0 , 100, e, std::exp(1.0));
+// test_bias(-1.0 , 4.0 , 100, e, std::exp(1.0));
}
/// Test the worked-out example given here:
- [lmi-commits] [lmi] branch odd/eraseme_error created (now 69d06e9), Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error dd8fb62 01/10: Postpone consideration of NaN-valued objective functions,
Greg Chicares <=
- [lmi-commits] [lmi] odd/eraseme_error 1dbe0b4 02/10: Refactor, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error a3f38b5 03/10: Refactor instrumented reference implementation, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error 4d0358c 04/10: Rename an enumeration, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error 2870f56 05/10: Reenumerate root-finding techniques, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error b19754f 06/10: Show shifts in optional trace, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error dfd50b1 07/10: Find a root that coincides with an input bound, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error dec4d54 09/10: Rename operations, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error 69d06e9 10/10: Attempt to find a problem, Greg Chicares, 2021/07/07
- [lmi-commits] [lmi] odd/eraseme_error b862db3 08/10: Uniformly test two functions in parallel, Greg Chicares, 2021/07/07