On Sat, Mar 7, 2020 at 1:32 PM Steve Kargl <s...@troutmask.apl.washington.edu> wrote: > > Fix the simplification and handling of the degree trigonometric functions. > This includes fixing a number of ICEs. See PR 93871. > > ChangeLog and patch attached.
As the author of the original degree-trig functions I intend to review this patch soon, and... > On Fri, Mar 06, 2020 at 03:18:19PM -0800, Steve Kargl wrote: > > > > 3. Simplification routines do the following mappings: > > sind(x) = sin((pi/180) * x) asind(x) = (180/pi) * asin(x) > > cosd(x) = cos((pi/180) * x) acosd(x) = (180/pi) * acos(x) > > tand(x) = tan((pi/180) * x) atand(x) = (180/pi) * atan(x) > > atan2d(y,x) = (180/pi) * atan2(y,x) > > cotand(x) = cotan((pi/180) * x) > > All computations are carried out by MPFR or MPC. > > In looking at some basic tests, the above simplification will > need to be modified to do what ... > > > > 5. New functions have been added to libgfortran to handle sind, cosd, > > and tand. > > ... these functions do. Otherwise, things like cos(real(60+123*360)) > give wrong values. Modifications are so easy even a lurker can do > them. ... extend the patch to include these changes (unless someone enthusiastic gets around to these mods before I do). I should be able to start on this next week (around 16 March). --- Fritz Reese