Ryeppp
This gem provides bindings to the Yeppp! library. According to the documentation, "Yeppp! is a high-performance SIMD-optimized mathematical library for x86, ARM, and MIPS processors on Windows, Android, Mac OS X, and GNU/Linux systems."
Installation
Add this line to your application's Gemfile:
gem 'ryeppp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ryeppp
You'll also need to download the Yeppp! library and unpack it in $HOME.
Usage
The Ryeppp gem provides a single class Ryeppp
with the following methods:
add_v64fv64f_v64f
- pairwise add 2 vectors of floatsadd_v64sv64s_v64s
- pairwise add 2 vectors of integerssubtract_v64fv64f_v64f
- pairwise subtract 2 vectors of floatssubtract_v64sv64s_v64s
- pairwise subtract 2 vectors of integersmultiply_v64fs64f_v64f
- multiply a vector of floats by a floatmultiply_v64sv64s_v64s
- multiply a vector of integers by an integermultiply_v64fv64f_v64f
- pairwise multiply 2 vectors of floatsmultiply_v64ss64s_v64s
- pairwise multiply 2 vectors of integersdotproduct_v64fv64f_s64f
- compute the dot product of 2 vectors of floatsmin_v64f_s64f
- find the minimum in a vector of floatsmin_v64s_s64s
- find the minimum in a vector of integersmax_v64f_s64f
- find the maximum in a vector of floatsmax_v64s_s64s
- find the maximum in a vector of integersmin_v64fv64f_v64f
- find the pairwise minimum in 2 vectors of floatsmax_v64fv64f_v64f
- find the pairwise maximum in 2 vectors of floatsmin_v64fs64f_v64f
- find the pairwise minimum of a vector of floats and a constantmax_v64fs64f_v64f
- find the pairwise maximum of a vector of floats and a constantnegate_v64f_s64f
- negate a vector of floatsnegate_v64s_s64s
- negate a vector of integerssum_v64f_s64f
- compute the sum of a vector of floatssumabs_v64f_s64f
- compute the sum of the absolute values of a vector of floatssumsquares_v64f_s64f
- compute the sum of the squares of the values of a vector of floatslog_v64f_v64f
- compute the natural logarithm of the values of a vector of floatsexp_v64f_v64f
- compute the base-e exponent of the values of a vector of floatssin_v64f_v64f
- compute the sine of the values of a vector of floatscos_v64f_v64f
- compute the cosine of the values of a vector of floatstan_v64f_v64f
- compute the tangent of the values of a vector of floatsevaluatepolynomial_v64fv64f_v64f
- evaluate the polynomial with the given float coefficients in standard form at the given x-values
Benchmarks
Since Yeppp! depends on your processor, using the library may or may not provide performance improvements, so it's important to benchmark your code on your own processor. A few benchmarks are provided, and the examples also provide performance comparisons.
To run the benchmarks, simply run
$ ruby lib/ryeppp/bench.rb
TODO
Add more benchmarks.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request