Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille committed Nov 8, 2023
1 parent 7bc4dd0 commit 1678ced
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions include/xsimd/arch/generic/xsimd_generic_math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,8 @@ namespace xsimd
template <class A, class T>
inline batch<std::complex<T>, A> polar(const batch<T, A>& r, const batch<T, A>& theta, requires_arch<generic>) noexcept
{
#ifndef EMSCRIPTEN
auto sincosTheta = sincos(theta);
return { r * sincosTheta.second, r * sincosTheta.first };
#else
return { r * cos(theta), r * sin(theta) };
#endif
}

// fdim
Expand Down
4 changes: 4 additions & 0 deletions include/xsimd/arch/generic/xsimd_generic_trigo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@ namespace xsimd
template <class A, class T>
inline std::pair<batch<T, A>, batch<T, A>> sincos(batch<T, A> const& self, requires_arch<generic>) noexcept
{
#if defined(EMSCRIPTEN)
return std::make_pair(sin(self, A{}), cos(self, A{}));
#else
using batch_type = batch<T, A>;
const batch_type x = abs(self);
batch_type xr = constants::nan<batch_type>();
Expand All @@ -721,6 +724,7 @@ namespace xsimd
auto cos_sign_bit = select((swap_bit ^ tmp) != batch_type(0.), constants::signmask<batch_type>(), batch_type(0.));
const batch_type cos_z1 = select(swap_bit != batch_type(0.), se, ce);
return std::make_pair(sin_z1 ^ sin_sign_bit, cos_z1 ^ cos_sign_bit);
#endif
}

template <class A, class T>
Expand Down

0 comments on commit 1678ced

Please sign in to comment.