<commit_before>#ifndef VXL_RSQRT_HPP
# define VXL_RSQRT_HPP
# pragma once

#include "vector.hpp"

#if defined(__SSE__)

# include "xmmintrin.h"

#endif // __SSE__

#if defined(__SSE3__)

#include "pmmintrin.h"

#endif // __SSE3__

#if defined (__SSE4_1__)

#include "smmintrin.h"

#endif // __SSE4_1__

#if defined(__ARM_NEON)

#include "arm_neon.h"

#endif // __ARM_NEON

namespace vxl
{

// reciprocal square root and square root
// https://en.wikipedia.org/wiki/Fast_inverse_square_root

#if defined(__ARM_NEON)

//__attribute__ ((noinline))
inline auto rsqrt(vector<float, 1> const& x) noexcept
{
  auto r(vrsqrte_f32(float32x2_t(x.data_)));

  r *= vrsqrts_f32(float32x2_t(x), r * r);

  return vector<float, 2>{
    vector_type(
      r * (vrsqrts_f32(float32x2_t(x), r * r))
    )
  };
}

//__attribute__ ((noinline))
inline auto rsqrt(vector<float, 2> const& x) noexcept<commit_msg>some fixes<commit_after>#ifndef VXL_RSQRT_HPP
# define VXL_RSQRT_HPP
# pragma once

#include "vector.hpp"

#if defined(__SSE__)

# include "xmmintrin.h"

#endif // __SSE__

#if defined(__SSE3__)

#include "pmmintrin.h"

#endif // __SSE3__

#if defined (__SSE4_1__)

#include "smmintrin.h"

#endif // __SSE4_1__

#if defined(__ARM_NEON)

#include "arm_neon.h"

#endif // __ARM_NEON

namespace vxl
{

// reciprocal square root and square root
// https://en.wikipedia.org/wiki/Fast_inverse_square_root

#if defined(__ARM_NEON)

//__attribute__ ((noinline))
inline auto rsqrt(vector<float, 1> const& x) noexcept
{
  using vector_type = typename vector_traits<float, 2>::vector_type;

  auto r(vrsqrte_f32(float32x2_t(vector_type{x.data_})));

  r *= vrsqrts_f32(float32x2_t(x), r * r);

  return vector<float, 2>{
    vector_type(
      r * (vrsqrts_f32(float32x2_t(x), r * r))
    )
  };
}

//__attribute__ ((noinline))
inline auto rsqrt(vector<float, 2> const& x) noexcept
{'fraction_non_alphanumeric': 0.139247311827957, 'fraction_numerical': 0.026344086021505377, 'mean_word_length': 4.5222551928783385, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3035924', 'n_tokens_mistral': 830, 'n_tokens_neox': 776, 'n_words': 157}