Lyapunov Exponent Shader
The Lyapunov exponent is a measure of the stability of a dynamical system. It describes how much a small error of the input will affect the system. The calculation of the graph in the range -1 to 0 for a subset of the complex plane can produce very aesthetic pictuers. The implemantation as a pixel shader 3.0 code is very easy because its just an iteration for every point on the screen. The code for each pixel is as simpe as that:
// Compute single Lyapunov lambda value
float lyapunovExponent (const float2 ab)
{
double r;
double sum = 0;
double x = xStart;
int k;
for(k = 0; k < MaxIter+WarmUp; k++){
r = sequence(k) ? ab.x : ab.y;
x = r * x * ( 1-x );
if (k >= WarmUp) sum += log( r - 2*r*x );
}
return sum/MaxIter;
}
Where ab is a 2D point in the complex plane, which is related to the pixel position on the screen and sequence(k) is a simple function, which chooses the x or y coordinate for each iteration.
Here is the download and here a picture:


