This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
dilog function
- From: Laurent Nguyen-Ngoc <laurent dot nguyenngoc at free dot fr>
- To: gsl-discuss at sources dot redhat dot com
- Date: Sat, 13 Sep 2003 02:58:56 +0200
- Subject: dilog function
I had a routine to write in which I needed the dilog function so I
naturally turned to GSL. After checking GSL's routine vs. Mathematica
results for the dilog function, I came across the following observation:
To get the dilog of a complex number z, I needed the sequence:
r=abs(z)
theta = atan2(z.im, z.re)
gsl_sf_angle_restrict_pos_e(&theta)
gsl_sf_complex_dilog_e(r,theta, &di_z_re, &di_z_im)
where di_z_re, di_z_im are of gsl_sf_result type.
Failure to have theta in the right determination (by restrict_pos)
gives, for some z, the conjugate answer (or the negative of it, I don't
remember).
This seems undocumented -or I skipped it... I just realized that by
comparing to Mathematica results.
Best,
Laurent