Area of largest semicircle that can be drawn inside a square

Given a square of side a, the task is to find the area of the largest semi-circle that can be drawn inside the square.


Input: a = 3
Output: 4.84865

Input: a = 4
Output: 8.61982

The semicircle of maximal area inscribed in the square has its diameter parallel to a diagonal, and its radius rmax is given as: