He was a medieval Persian astronomer, mathematician, and poet who wrote poetry extolling hedonism and criticizing religion.