You should not use "100" and "100" but L1 and L2.
float L1 = 100;
float L2 = 100;
Shouldn't the numerator be (not using the hypotenuse):
float numerator = (X^2 + y^2) + (L1^2 - L2^2)
And the denominator be:
float denominator = (2 * L1) * (sqrt(X^2 + y^2))) // L1 = Shoulder to elbow: 100 mm
X and Y are the movement and L1 and L2 are the lengths...