From dacd8e7b889411c157b0019c162c6c1775f002d3 Mon Sep 17 00:00:00 2001 From: Simon Rohou Date: Tue, 28 Jul 2026 23:07:57 +0200 Subject: [PATCH] [op] corrected bug in several definition domains --- src/core/operators/codac2_abs.h | 4 ++-- src/core/operators/codac2_acos.h | 4 ++-- src/core/operators/codac2_arith_div.h | 12 ++++++------ src/core/operators/codac2_asin.h | 2 +- src/core/operators/codac2_atan2.h | 4 ++-- src/core/operators/codac2_log.h | 4 ++-- src/core/operators/codac2_max.h | 2 +- src/core/operators/codac2_sign.h | 4 ++-- src/core/operators/codac2_sqrt.h | 4 ++-- src/core/operators/codac2_tan.h | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/core/operators/codac2_abs.h b/src/core/operators/codac2_abs.h index 9005b03f4..452342b67 100644 --- a/src/core/operators/codac2_abs.h +++ b/src/core/operators/codac2_abs.h @@ -55,7 +55,7 @@ namespace codac2 { return { fwd(x1.a), - x1.def_domain && x1.a != 0. // def domain of the derivative of abs + x1.def_domain && !x1.a.contains(0.) // def domain of the derivative of abs }; } @@ -72,7 +72,7 @@ namespace codac2 fwd(x1.m), fwd(x1.a), d, - x1.def_domain && x1.a != 0. // def domain of the derivative of abs + x1.def_domain && !x1.a.contains(0.) // def domain of the derivative of abs }; } diff --git a/src/core/operators/codac2_acos.h b/src/core/operators/codac2_acos.h index b54a0e680..e4f57dc05 100644 --- a/src/core/operators/codac2_acos.h +++ b/src/core/operators/codac2_acos.h @@ -56,7 +56,7 @@ namespace codac2 return { fwd(x1.a), x1.a.is_subset({-1,1}) // def domain of acos - && x1.a != 1. // def domain of the derivative of acos + && !x1.a.contains(1.) // def domain of the derivative of acos && x1.def_domain }; } @@ -75,7 +75,7 @@ namespace codac2 fwd(x1.a), d, x1.a.is_subset({-1,1}) // def domain of acos - && x1.a != 1. // def domain of the derivative of acos + && !x1.a.contains(1.) // def domain of the derivative of acos && x1.def_domain }; } diff --git a/src/core/operators/codac2_arith_div.h b/src/core/operators/codac2_arith_div.h index 4b1716978..5fa23b9ae 100644 --- a/src/core/operators/codac2_arith_div.h +++ b/src/core/operators/codac2_arith_div.h @@ -82,7 +82,7 @@ namespace codac2 { return { fwd(x1.a, x2.a), - x1.def_domain && x2.def_domain && x2.a != 0. // def domain of the derivative of div + x1.def_domain && x2.def_domain && !x2.a.contains(0.) // def domain of the derivative of div }; } @@ -101,7 +101,7 @@ namespace codac2 fwd(x1.m, x2.m), fwd(x1.a, x2.a), d, - x1.def_domain && x2.def_domain && x2.a != 0. // def domain of the derivative of div + x1.def_domain && x2.def_domain && !x2.a.contains(0.) // def domain of the derivative of div }; } @@ -128,7 +128,7 @@ namespace codac2 { return { fwd(x1.a, x2.a), - x1.def_domain && x2.def_domain && x2.a != 0. // def domain of the derivative of div + x1.def_domain && x2.def_domain && !x2.a.contains(0.) // def domain of the derivative of div }; } @@ -149,7 +149,7 @@ namespace codac2 fwd(x1.m, x2.m), fwd(x1.a, x2.a), d, - x1.def_domain && x2.def_domain && x2.a != 0. // def domain of the derivative of div + x1.def_domain && x2.def_domain && !x2.a.contains(0.) // def domain of the derivative of div }; } @@ -169,7 +169,7 @@ namespace codac2 { return { fwd(x1.a, x2.a), - x1.def_domain && x2.def_domain && x2.a != 0. // def domain of the derivative of div + x1.def_domain && x2.def_domain && !x2.a.contains(0.) // def domain of the derivative of div }; } @@ -191,7 +191,7 @@ namespace codac2 fwd(x1.m, x2.m), fwd(x1.a, x2.a), d, - x1.def_domain && x2.def_domain && x2.a != 0. // def domain of the derivative of div + x1.def_domain && x2.def_domain && !x2.a.contains(0.) // def domain of the derivative of div }; } diff --git a/src/core/operators/codac2_asin.h b/src/core/operators/codac2_asin.h index d91d6a375..a3e4bdc68 100644 --- a/src/core/operators/codac2_asin.h +++ b/src/core/operators/codac2_asin.h @@ -56,7 +56,7 @@ namespace codac2 return { fwd(x1.a), x1.a.is_subset({-1,1}) // def domain of asin - && x1.a != 1. // def domain of the derivative of asin + && !x1.a.contains(1.) // def domain of the derivative of asin && x1.def_domain }; } diff --git a/src/core/operators/codac2_atan2.h b/src/core/operators/codac2_atan2.h index 38ab99081..199d6c3f9 100644 --- a/src/core/operators/codac2_atan2.h +++ b/src/core/operators/codac2_atan2.h @@ -58,7 +58,7 @@ namespace codac2 return { fwd(x1.a, x2.a), x1.def_domain && x2.def_domain - && !(x1.a == 0. && x2.a == 0.) // def domain of the derivative of atan2 + && !(x1.a.contains(0.) && x2.a.contains(0.)) // def domain of the derivative of atan2 }; } @@ -79,7 +79,7 @@ namespace codac2 fwd(x1.a, x2.a), d, x1.def_domain && x2.def_domain - && !(x1.a == 0. && x2.a == 0.) // def domain of the derivative of atan2 + && !(x1.a.contains(0.) && x2.a.contains(0.)) // def domain of the derivative of atan2 }; } diff --git a/src/core/operators/codac2_log.h b/src/core/operators/codac2_log.h index 8be715c3a..de82d4f52 100644 --- a/src/core/operators/codac2_log.h +++ b/src/core/operators/codac2_log.h @@ -59,7 +59,7 @@ namespace codac2 return { fwd(x1.a), x1.a.is_subset({0,oo}) // def domain of log - && x1.a != 0. // def domain of the derivative of log + && !x1.a.contains(0.) // def domain of the derivative of log && x1.def_domain }; } @@ -78,7 +78,7 @@ namespace codac2 fwd(x1.a), d, x1.a.is_subset({0,oo}) // def domain of log - && x1.a != 0. // def domain of the derivative of log + && !x1.a.contains(0.) // def domain of the derivative of log && x1.def_domain }; } diff --git a/src/core/operators/codac2_max.h b/src/core/operators/codac2_max.h index fc148785e..514974f9f 100644 --- a/src/core/operators/codac2_max.h +++ b/src/core/operators/codac2_max.h @@ -69,7 +69,7 @@ namespace codac2 fwd(x1.a, x2.a), d, x1.def_domain && x2.def_domain - && (x1.a != x2.a) // def domain of the derivative of max + && !x1.a.intersects(x2.a) // def domain of the derivative of max }; } diff --git a/src/core/operators/codac2_sign.h b/src/core/operators/codac2_sign.h index c9d4deaa1..2d048bbe8 100644 --- a/src/core/operators/codac2_sign.h +++ b/src/core/operators/codac2_sign.h @@ -55,7 +55,7 @@ namespace codac2 { return { fwd(x1.a), - x1.def_domain && x1.a != 0. // def domain of the derivative of sign + x1.def_domain && !x1.a.contains(0.) // def domain of the derivative of sign }; } @@ -68,7 +68,7 @@ namespace codac2 fwd(x1.m), fwd(x1.a), IntervalMatrix::zero(1,x1.da.size()), - x1.def_domain && x1.a != 0. // def domain of the derivative of sign + x1.def_domain && !x1.a.contains(0.) // def domain of the derivative of sign }; } diff --git a/src/core/operators/codac2_sqrt.h b/src/core/operators/codac2_sqrt.h index af2b08803..8e79d7375 100644 --- a/src/core/operators/codac2_sqrt.h +++ b/src/core/operators/codac2_sqrt.h @@ -56,7 +56,7 @@ namespace codac2 return { fwd(x1.a), x1.a.is_subset({0,oo}) // def domain of sqrt - && x1.a != 0. // def domain of the derivative of sqrt + && !x1.a.contains(0.) // def domain of the derivative of sqrt && x1.def_domain }; } @@ -75,7 +75,7 @@ namespace codac2 fwd(x1.a), d, x1.a.is_subset({0,oo}) // def domain of sqrt - && x1.a != 0. // def domain of the derivative of sqrt + && !x1.a.contains(0.) // def domain of the derivative of sqrt && x1.def_domain }; } diff --git a/src/core/operators/codac2_tan.h b/src/core/operators/codac2_tan.h index 6fede84ab..87795874a 100644 --- a/src/core/operators/codac2_tan.h +++ b/src/core/operators/codac2_tan.h @@ -55,7 +55,7 @@ namespace codac2 { return { fwd(x1.a), - x1.def_domain && cos(x1.a) != 0. // def domain of the derivative of tan + x1.def_domain && !cos(x1.a).contains(0.) // def domain of the derivative of tan }; } @@ -72,7 +72,7 @@ namespace codac2 fwd(x1.m), fwd(x1.a), d, - x1.def_domain && cos(x1.a) != 0. // def domain of the derivative of tan + x1.def_domain && !cos(x1.a).contains(0.) // def domain of the derivative of tan }; }