https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103005
Bug ID: 103005 Summary: experimental simd sin and cos with big arguments returns values bigger than 1 Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: andreas_roever at web dot de Target Milestone: --- Created attachment 51704 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51704&action=edit example program displaying the problem there seems to be a bug in the sin and cos functions for the experimental/simd header. When giving a very big argument to those functions they return values outside the range -1 .. 1. I understand that the result will be quite meaningless for such big values. But I'd argue that it should always be in the range -1..1. so calculating sin(-2985064393126969344) gives 2527133379.389218 This is on Linux compiled with g++-11.2.0 -g -march=native --std=c++20 test1.cpp here the CPU info (for one core) processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 94 model name : Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz stepping : 3 microcode : 0xc2 cpu MHz : 3301.335 cache size : 6144 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 22 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp vmx flags : vnmi preemption_timer invvpid ept_x_only ept_ad ept_1gb flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest ple shadow_vmcs pml bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs taa itlb_multihit srbds bogomips : 6399.96 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual