The generator type should be an invocable which supports the following operations:
The value of the continued fraction is returned. \(\displaystyle \frac{a_0}{b_0+\frac{a_1}{b_1+\frac{a_2}{b_2+\cdots\vphantom{\frac{1}{1}} }}}\)
#include <eve/module/math.hpp>
#include <iostream>
template <class T>
struct const_fraction
{
typedef T result_type;
result_type operator()()
{
return T{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
}
};
int main()
{
eve::wide z{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
std::cout << "ref constant fracs are: " << ref << std::endl;
const_fraction<decltype(z)> func;
std::cout << " constant fracs are: " << gr << std::endl;
}
constexpr auto sqr
Computes the square of the parameter.
Definition sqr.hpp:97
constexpr auto sqrt
Computes the elementwise square root of the parameter.
Definition sqrt.hpp:81
constexpr auto eps
Computes a constant to the machine epsilon.
Definition eps.hpp:74
Lightweight type-wrapper.
Definition as.hpp:29
Wrapper for SIMD registers.
Definition wide.hpp:94