Hayy ibn Yaqdhan an Islamic philosophical tale ( or thought experiment ) by Ibn Tufail from twelfth-century Andalusia , straddles the divide between the religious and the secular . Hayy ibn Yaqdhan an Islamic philosophical tale ( or thought experiment ) by Ibn Tufail from 12th-century Andalusia , straddles the divide between the religious and the secular .