diff --git a/include/kyosu/types/impl/bessel/sb_ikn.hpp b/include/kyosu/types/impl/bessel/sb_ikn.hpp index f09ee5e4..167733f8 100644 --- a/include/kyosu/types/impl/bessel/sb_ikn.hpp +++ b/include/kyosu/types/impl/bessel/sb_ikn.hpp @@ -59,13 +59,14 @@ namespace kyosu::_ auto sb_i2n(N n, Z z, R & sis) noexcept { using e_t = as_real_type_t; - auto iton = [](N n){ - if (n%4 == 0) return complex(eve::one(eve::as())); - else if (n%4 == 1) return complex(eve::zero(eve::as()), eve::one(eve::as())); - else if (n%4 == 2) return complex(eve::mone(eve::as())); - else return complex(eve::zero(eve::as()), eve::mone(eve::as())); + auto riton = [](N n){ + n = n & N(3); + if (n == 0) return complex(eve::one(eve::as())); + else if (n == 1) return complex(eve::zero(eve::as()), eve::mone(eve::as())); + else if (n == 2) return complex(eve::mone(eve::as())); + else return complex(eve::zero(eve::as()), eve::one(eve::as())); }; - return rec(iton(n +1))*sph_bessel_yn(n,muli(z), sis); + return riton(n+1)*sph_bessel_yn(n,muli(z), sis); } diff --git a/include/kyosu/types/impl/detail/cylseq.hpp b/include/kyosu/types/impl/detail/cylseq.hpp deleted file mode 100644 index a9ae7bc2..00000000 --- a/include/kyosu/types/impl/detail/cylseq.hpp +++ /dev/null @@ -1,51 +0,0 @@ -//====================================================================================================================== -/* - Kyosu - Complex Without Complexes - Copyright : KYOSU Contributors & Maintainers - SPDX-License-Identifier: BSL-1.0 -*/ -//====================================================================================================================== -#pragma once - -namespace kyosu::_ -{ - - template - void dispatch(eve::tag_of, F f, size_t n, Z z, Ra & cbs) noexcept - { - std::cout << "icitte seq" << std::endl; - if constexpr(concepts::complex) - { - if constexpr(concepts::cayley_dickson) - *std::begin(cbs) = f; - else - *std::begin(cbs) = f(n, z); - if (n == 0) - return; - else - { - auto rz = kyosu::rec(z); - EVE_ASSERT(cbs.size() >= n+1, "cbs has not room enough"); - auto rs =kyosu::_:: R(n, z); - int i = n-1; - - auto cur = std::rbegin(cbs); - *cur = f(n, z); - auto pred = cur++; - while (i >= 0) - { - *cur++ = *pred++*rs; - rs = 2*(i--)*rz-kyosu::rec(rs); - } - } - } - else - { - auto p = kyosu::pure(z); - auto az = kyosu::abs(p); - cyl_bessel_cbs(n, kyosu::complex(kyosu::real(z), az), cbs); - for(size_t i = 0; i <= n; ++i) cbs[i] = kyosu::real(cbs[i]) + kyosu::ipart(cbs[i])*kyosu::sign(p); - } - } - -}