25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lolremez.cpp 801 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // LolRemez - Remez algorithm implementation
  3. //
  4. // Copyright: (c) 2005-2013 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://www.wtfpl.net/ for more details.
  9. //
  10. #if defined HAVE_CONFIG_H
  11. # include "config.h"
  12. #endif
  13. #include <lol/main.h>
  14. #include <lol/math/real.h>
  15. #include "solver.h"
  16. using lol::real;
  17. /* See the tutorial at http://lolengine.net/wiki/doc/maths/remez */
  18. real f(real const &x)
  19. {
  20. return exp(x);
  21. }
  22. real g(real const &x)
  23. {
  24. return exp(x);
  25. }
  26. int main(int argc, char **argv)
  27. {
  28. UNUSED(argc, argv);
  29. RemezSolver solver(4, 40);
  30. solver.Run(-1, 1, f, g);
  31. return 0;
  32. }