function tan_a(u) result(o) type(ad_t),intent(in)::u type(ad_t)::o o = ad_t( tan(u%val()) , (tan(u%val())**2+1.0_wp)*u%grad() ) end function tan_a