Generated partition points
Sample a value from the distribution.
import mir.math : approxEqual; import std.meta : AliasSeq; import mir.random.engine.xorshift : Xorshift; auto gen = Xorshift(42); alias S = double; auto f0 = (S x) => -x^^4 + 5 * x^^2 - 4; auto f1 = (S x) => 10 * x - 4 * x^^3; auto f2 = (S x) => 10 - 12 * x^^2; S[] points = [-3, -1.5, 0, 1.5, 3]; auto tf = flex(f0, f1, f2, 1.5, points, 1.1); auto value = tf(gen);
Data body of the Flex algorithm. Can be used to sample from the distribution.