Skip to content

Commit

Permalink
minor modifications to interval example
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkichler committed Jul 16, 2024
1 parent cdb135c commit fd98804
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions examples/basic/basic.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -38,6 +39,7 @@ constexpr auto f(auto x, auto y)
print(j);
print(k);
print(l);
print(m);
return a;
}

Expand Down
8 changes: 4 additions & 4 deletions examples/interval/interval.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions include/cutangent/arithmetic/basic.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ fn tangent<T> pow(auto x, tangent<T> n)
template<typename T>
fn tangent<T> pow(tangent<T> x, tangent<T> n)
{
using std::log;
using std::pow;

return { pow(x.v, n.v),
Expand Down

0 comments on commit fd98804

Please sign in to comment.