math.hpp (422B)
1 #pragma once 2 3 #include "base.hpp" 4 #include "table.hpp" 5 6 namespace bogaudio { 7 namespace dsp { 8 9 struct FastTanhf { 10 struct TanhfTable : Table { 11 TanhfTable(int n) : Table(n) {} 12 void _generate() override; 13 }; 14 struct StaticTanhfTable : StaticTable<TanhfTable, 11> {}; 15 const Table& _table; 16 17 FastTanhf() : _table(StaticTanhfTable::table()) { 18 } 19 20 float value(float radians); 21 }; 22 23 } // namespace dsp 24 } // namespace bogaudio