An exposure automation program used in many cameras, digital or not, uses an algorithm adjusting the shutter speed and aperture depending on scene luminance (brightness). Out of many possible such algorithms, one of the simplest and most predictable is the 45degree scheme used, I believe, in most cameras.
The principle of this algorithm is simple. Starting from the lowest luminance (EV value) and progressing towards higher values, the exposure parameters are adjusted as follows:

At lowest light levels the aperture stays fully open (at the minimum Fnumber a_{1}), and only the shutter speed is being adjusted. As the luminance increases, so does the shutter speed, until it reaches some predefined value, s_{1} (this value may depend on the lens focal length, and often is set to the slowest handholdable shutter speed at that length).

At that point, further increase in luminance causes both the aperture and shutter speed to be adjusted in equal amounts; i.e., each 1 EV (doubling) of the scene brightness leads to the aperture being closed down by 1/2 of a stop (0.5 EV) and the shutter speed faster by the same amount. This continues until the aperture reaches another predefined value, a_{2}. (For some cameras, especially film ones, this may be the maximum Fnumber; for digital it may be lower, being the value at which the image starts suffering degradation due to diffraction effects). This is the 45° part of the program.

From that point on, the camera responds to further increase in luminosity by increasing shutter speeds up to the highest one availablele, s_{2}.

When that happens, the system starts closing the aperture down until the maximum Fnumber, a_{2} is reached. (If a_{2}=a_{3}, this point is not applied and the program runs out adjustment capacity in [3].)
To compute shutter speeds and apertures set by a 45degree exposure automation program, you need five data items:

a_{1} — the lowest Fnumber of the lens aperture;

a_{2} — the Fnumber at which the program

a_{3} — its highest Fnumber;

s_{1} — the lowest handholdable shutter speed denominator;

s_{2} — the highest shutter speed (denominator, again).
The first step will be to compute the three transition points of the program curve as EV values. Let us denote these as v_{12}, v_{23}, v_{34}. The program will use aperture a_{1} for light values below v_{1}, on the other extreme it will use a_{2} above v_{2}, adjusting both shutter speed and aperture between v_{1} and v_{2}.
The value of v_{1} can be computed as
v_{1} = log_{2} (s_{1}a_{1}^{2})
where log_{2} stands for logarithm base two; if your calculator does not offer this option (mine does), you may compute log_{2}x as log x/log 2, with log being either decimal or natural logarithm.
In a similar way, v_{2} will be
v_{1} = log_{2} (s_{1}a_{2}^{4}/a_{1}^{2})
For a given EV value, v, the programselected aperture and shutter values are given in one of four ways:

For v ≤ v_{1}:
a = a_{1}
and
s = 2^{v}/a_{1}^{2}

For v ≥ v_{2}:
a = a_{2}
and
s = 2^{v}/a_{2}^{2}

For v_{1} ≤ v ≤ v_{2} (this is where the program mode becomes really something different that aperture priority at the lens fully open or closed):
a = (2^{v}a_{1}^{2}/s_{1})^{1/4}
and
s = (2^{v}s_{1}/a_{1}^{2})^{1/2}
where a is the Fnumber value and s — the shutter speed denominator (so that s=125 means 1/125 s).
