Skip to content

Commit

Permalink
pow bad constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap committed Sep 26, 2023
1 parent 36e303f commit dafaf1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/kyosu/types/impl/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ namespace kyosu::_
return kyosu::if_else(eve::is_ltz(c1), kyosu::rec(tmp), tmp);
}
}
else if constexpr(kyosu::concepts::complex<C0> || kyosu::concepts::complex<C1>)
else if constexpr((dimension_v<C0> <= 2) && (dimension_v<C1> <= 2))
{
r_t r;
if constexpr(eve::floating_value<C0> && kyosu::concepts::complex<C1>) // c1 is complex c0 is real
Expand Down Expand Up @@ -412,7 +412,9 @@ namespace kyosu::_
}
else if constexpr( kyosu::concepts::complex<C0>)// c0 and c1 are complex
{
auto [rc1, ic1] = c1;
// auto rc1 = real(c1);
// auto ic1 = imag(c1);
auto [rc1, ic1] = c1;
auto lc0 = kyosu::log_abs(c0);
auto argc0 = kyosu::arg(c0);
auto rho = eve::exp(eve::pedantic(eve::diff_of_prod)(lc0, rc1, ic1, argc0));
Expand All @@ -421,7 +423,7 @@ namespace kyosu::_
auto realc0 = is_real(c0);
if(eve::any(realc0))
{
auto rr = complex(kyosu::pow(real(c0), c1));
auto rr = kyosu::pow(real(c0), c1);
r = kyosu::if_else(realc0, rr, r);
}
}
Expand Down

0 comments on commit dafaf1b

Please sign in to comment.