Your Base class and Derived seem to represent a function only having a single member function, so we could most likely do away with the polymorphism completely and pass a function into algo:
#include <iostream>
#include <utility>
template <class Function>
class algo
{
double t;
Function fn;
public:
algo(double t, const Function& fn)
: t{t}, fn{fn}
{ }
double method(double x){ return t * fn(x);}
};
template <class Function>
algo<Function> make_algo(double t, Function&& fn)
{
return algo<Function>(t, std::forward<Function>(fn));
}
int main()
{
const double someValue = 123;
const double anotherValue = 987;
auto algo = make_algo(anotherValue, [someValue](double otherValue) {
return someValue * otherValue;
});
std::cout << std::fixed << algo.method(321) << std::endl;
}