From fd98804b8e74b8b89833d3ee3abfb5ee644a09d7 Mon Sep 17 00:00:00 2001 From: Neil Kichler Date: Tue, 16 Jul 2024 17:36:54 +0200 Subject: [PATCH] minor modifications to interval example --- examples/basic/basic.cu | 2 ++ examples/interval/interval.cu | 8 ++++---- include/cutangent/arithmetic/basic.cuh | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/basic/basic.cu b/examples/basic/basic.cu index 4925b99..1e972d1 100644 --- a/examples/basic/basic.cu +++ b/examples/basic/basic.cu @@ -25,6 +25,7 @@ constexpr auto f(auto x, auto y) auto j = exp(x); auto k = log(x); auto l = pown(x, 2); + auto m = x * 2; print(a); print(b); @@ -38,6 +39,7 @@ constexpr auto f(auto x, auto y) print(j); print(k); print(l); + print(m); return a; } diff --git a/examples/interval/interval.cu b/examples/interval/interval.cu index 188de2a..83dc3d7 100644 --- a/examples/interval/interval.cu +++ b/examples/interval/interval.cu @@ -22,7 +22,7 @@ constexpr auto f(auto x, auto y) // auto a = neg(x); // auto a = add(x, y); // auto a = sub(x, y); - auto a = mul(x, y); + // auto a = mul(x, y); // auto a = div(x, y); // auto a = x + y; // auto a = x - y; @@ -36,9 +36,9 @@ constexpr auto f(auto x, auto y) // auto a = recip(x); // auto a = cos(x); // auto a = pown(x, 3); - // auto a = pown(x, 4); - // auto a = pow(x, 4); - // auto a = pow(x, y); // not yet supported by McCormick + // auto a = pown(x, 4.0); + // auto a = pow(x, 4.0); + auto a = pow(x, y); // auto a = max(x, y); // auto a = min(x, y); // auto a = hull(x, y); diff --git a/include/cutangent/arithmetic/basic.cuh b/include/cutangent/arithmetic/basic.cuh index c9d90e4..d512299 100644 --- a/include/cutangent/arithmetic/basic.cuh +++ b/include/cutangent/arithmetic/basic.cuh @@ -220,6 +220,7 @@ fn tangent pow(auto x, tangent n) template fn tangent pow(tangent x, tangent n) { + using std::log; using std::pow; return { pow(x.v, n.v),