The force exerted by a spring is expressed as:
where F is the force, x is how far it's stretched and k is the spring rate, or spring constant.
The potential energy of a spring looks suspiciously like the standard Kinetic Energy formula:
Since most hammer springs have some preload in the hammer down position, the formula should be.
PE= 1/2k(x1^2-x0^2) or the potential energy of the spring in the cocked position minus the potential energy of the spring in the uncocked position.
The formula should look suspiciously like the KE formula since they both describe a function that looks suspiciously like the area of a triangle.