1、BSI Standards Publication Information Technology Programming languages, their environments, and system soft- ware interfaces Floating-point extensions for C Part 4: Supplementary functions PD ISO/IEC TS 18661-4:2015National foreword This Published Document is the UK implementation of ISO/IEC/TS 1866
2、1- 4:2015. The UK participation in its preparation was entrusted to Technical Committee IST/5, Programming languages, their environments and system software interfaces. A list of organizations represented on this committee can be obtained on request to its secretary. This publication does not purpor
3、t to include all the necessary provisions of a contract. Users are responsible for its correct application. The British Standards Institution 2015. Published by BSI Standards Limited 2015 ISBN 978 0 580 85489 7 ICS 35.060 Compliance with a British Standard cannot confer immunity from legal obligatio
4、ns. This Published Document was published under the authority of the Standards Policy and Strategy Committee on 30 November 2015. Amendments/corrigenda issued since publication Date Text affected PUBLISHED DOCUMENT PD ISO/IEC TS 18661-4:2015Information Technology Programming languages, their environ
5、ments, and system software interfaces Floating-point extensions for C Part 4: Supplementary functions Technologies de linformation Langages de programmation, leurs environnements et interfaces du logiciel systme Extensions virgule flottante pour C Partie 4: Fonctions supplmentaires ISO/IEC TS 18661-
6、4 First edition 2015-10-01 Reference number ISO/IEC TS 18661-4:2015(E) TECHNICAL SPECIFICATION ISO/IEC 2015 ii ISO/IEC 2015 All rights reserved COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2015, Published in Switzerland All rights reserved. Unless otherwise specified, no part of this publication may be repr
7、oduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISOs member body in the country of the requeste
8、r. ISO copyright office Ch. de Blandonnet 8 CP 401 CH-1214 Vernier, Geneva, Switzerland Tel. +41 22 749 01 11 Fax +41 22 749 09 47 copyrightiso.org www.iso.org ISO/IEC TS 18661-4:2015(E) PD ISO/IEC TS 18661-4:2015!“#$%“7L=!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9、XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX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XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX!*0! 0! KE;E8=!I;!XXXXXXXXXXXXXXXXXXXXXXXX
13、XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX!+3! *1! )BL=4A=5=887F!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX!+! *! 75F;:5;!87E5I!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
14、XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX!+! Z7A8:L?B!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX!Y*! PD ISO/IEC TS 18661-4:2015“#$%“;8:8!BR36788S!D%.;8:6!0BR2/02320!*-E#$!“?!6=f6677S! D%
15、.+28-fS! *-E#$! “*! 8F;8-=S! 6788!4/!26788O PD ISO/IEC TS 18661-4:2015“#$%“A87E5I! “8F!.512/5! 8 ,! .!678!“8!.0!14!R/4N.32!6788S! D6788! 4/! D.56788! 6788! 4/! 32A.C6788!6788O!$!.CRK2C251A87E5I!75!FELL=9=5;:8B!6E5;6788!0R2A.20!53!/2A4CC2530!C4/2!21250.N2!021!4!C1M2C1.AK!4R2/1.450! 1M5! $88! R/4N.320
16、O! “M2! #$! ;799! 0R2A.A1.45! .0! L252/KKT! A450.01251! Q.1M! $88S! 1M4BLM! .1! 330! /2VB./2C2510!4/!0TCC21/T!53!51.0TCC21/TO!“M.0!R/1!4!*-E#$!“*!8F;8!212530!1M2!0R2A.A1.45! .5! ).D/T! 0BDAKB02! O86! l1M2C1.A0! 14! .5AKB32! 1M2! A4CRK212! 021! 4! #$! ;799! C1M2C1.AK! 4R2/1.450O!,4/!.CRK2C2511.450!A4
17、54/C.5L!14!552!,S!.1!K04!/2VB./20!BKK!#$!;799!02C51.A0S! .5AKB3.5L!0TCC21/T!53!51.0TCC21/T!R/4R2/1.20O! PD ISO/IEC TS 18661-4:2015! ! ! ! !“#$%“799!/2VB./20!A4/2A1!/4B53.5L!4/!.10!/2VB./23!4R2/1.450!G0VB/2?441S!B023lBK1.RKT(33S!21AOHS! 53!/2A4CC2530!A4/2A1!/4B53.5L!4/!.10!/2A4CC25323!C1M2C1.AK!4R2/1
18、.450O!“M.0!R/1!4!*-E#$! “*!8F;8!/202/N20!.3251.2/0S!Q.1M!cr!R/2.20S!4/!$!B5A1.450!A4/20R453.5L!14!A4/2A1KT!/4B5323! N2/0.450!4!1M2!#$!;799!C1M2C1.AK!4R2/1.450S!QM.AM!CT!D2!R/4N.323!1!1M2!4R1.45!4!1M2! .CRK2C2511.45O!,4/!2CRK2S!1M2!.3251.2/!crexp!.0!/202/N23!4/!A4/2A1KT!/4B5323!N2/0.45!4!1M2! exp!B5A
19、1.45O! #$!;799!K04!0R2A.20!53!/2A4CC2530!/23BA1.45!4R2/1.450S!QM.AM!4R2/12!45!N2A14/!4R2/530O! “M202!4R2/1.450S!QM.AM!A4CRB12!0BC0!53!R/43BA10S!CT!004A.12!.5!5T!4/32/!53!CT!2NKB12!.5! 5T!Q.32/!4/C1O!%25A2S!B5K.2!41M2/!#$!;799!4R2/1.450S!1M2T!34!541!MN2!B5.VB2!0R2A.23!/20BK10O! “M.0!R/1!4!*-E#$!“*!8F
20、;8!212530!1M2!0R2A.A1.45!.5!).D/T!0BDAKB02!O86!l1M2C1.A0!14! .5AKB32! B5A1.450! A4/20R453.5L! 14! 1M2! #$! ;799! /23BA1.45! 4R2/1.450O! ,4/! .CRK2C2511.450! A454/C.5L!14!552!,S!.1!K04!/2VB./20!1M2!#$!;799!0R2A.23!D2MN.4/!4/!K41.5L:R4.51!2A2R1.450O PD ISO/IEC TS 18661-4:2015)?577AB!C!D87A8:99=F!C!K7:
21、;! #ELL=9=5;:8B!6E5;7L=! “M.0!R6788O! +! 756789:5=! (5!.CRK2C251=F! “M2!4KK4Q.5L!34ABC2510S!.5!QM4K2!4/!.5!R6788S!D%.7996788S! D%.;8:8678=S!D%.;8:66789S!D%.;8:f6789S!D%.;8:8678=S! *-E#$! “*! 8F;8:66789S! *-E#$! “*!8F;8:f6789S!6788S!D%.:5I:8I!756789:5=! OX*! K8=F;:5I87F! ?:5A=!;7!*!)#*233*4*!)#*233*4
22、+!)#*233*4YN! 5!;O87OFOfm8S! _STDC_IEC_60559_FUNCS_!“M2! .512L2/! A4501! n82o! “M2! 4KK4Q.5L! .3251.2/0! !.0!./01!.5AKB323! exp2m1 rootnf sinpil exp2m1f rootnl tanpi exp2m1l pown tanpif exp10 pownf tanpil exp10f pownl reduc_sum exp10l powr reduc_sumf exp10m1 powrf reduc_suml exp10m1f powrl reduc_sum
23、abs exp10m1l acospi reduc_sumabsf logp1 acospif reduc_sumabsl logp1f acospil reduc_sumsq PD ISO/IEC TS 18661-4:2015! ! ! ! !“#$%“=S! exp2m1dP powndP tanpidP exp10dP powrdP reduc_sumdP exp10m1dP acospidP reduc_sumabsdP logp1dP asinpidP reduc_sumsqdP log2p1dP atanpidP reduc_sumproddP log10p1dP atan2pi
24、dP scaled_proddP rsqrtdP cospidP scaled_prodsumdP compoundndP sinpidP scaled_proddiffdP rootndP !n8Lo!“M2!4KK4Q.5L!.3251.2/0!.0!./01!.5AKB323! 4/!0BRR4/123!1TR20!_FloatP! ! exp2m1fP pownfP tanpifP exp10fP powrfP reduc_sumfP exp10m1fP acospifP reduc_sumabsfP logp1fP asinpifP reduc_sumsqfP log2p1fP at
25、anpifP reduc_sumprodfP log10p1fP atan2pifP scaled_prodfP rsqrtfP cospifP scaled_prodsumfP compoundnfP sinpifP scaled_proddifffP rootnfP PD ISO/IEC TS 18661-4:2015“#$%“=S! exp2m1dP powndP tanpidP exp10dP powrdP reduc_sumdP exp10m1dP acospidP reduc_sumabsdP logp1dP asinpidP reduc_sumsqdP log2p1dP atan
26、pidP reduc_sumproddP log10p1dP atan2pidP scaled_proddP rsqrtdP cospidP scaled_prodsumdP compoundndP sinpidP scaled_proddiffdP rootndP 4/!0BRR4/123!1TR20!_DecimalPx! exp2m1dPx powndPx tanpidPx exp10dPx powrdPx reduc_sumdPx exp10m1dPx acospidPx reduc_sumabsdPx logp1dPx asinpidPx reduc_sumsqdPx log2p1d
27、Px atanpidPx reduc_sumproddPx log10p1dPx atan2pidPx scaled_proddPx rsqrtdPx cospidPx scaled_prodsumdPx compoundndPx sinpidPx scaled_proddiffdPx rootndPx (12/!O69m8AS!.502/1!1M2!R! n83o! “M2! 4KK4Q.5L! .3251.2/0! !.0!./01!.5AKB323! exp2m1 rsqrt asinpi exp10 compoundn atanpi exp10m1 rootn atan2pi logp
28、1 pown cospi log2p1 powr sinpi log10p1 acospi tanpi PD ISO/IEC TS 18661-4:2015! ! ! ! !“#$%“! n6fo!“M2!$!B5A1.450!.5!1M2!4KK4Q.5L!1DK2!R/4N.32!4R2/1.450!/2A4CC25323!DT!#$!;799!53! 0.C.K/!4R2/1.450O!$4/2A1!/4B53.5LS!QM.AM!#$!;799!0R2A.20!4/!.10!4R2/1.450!G2A2R1!4/! 1M2!/23BA1.45!4R2/1.450HS!.0!541!/2
29、VB./23!4/!1M2!$!B5A1.450!.5!1M2!1DK2O!*22!K04!Of8O;O! #$!;799!4R2/1.45! $!B5A1.45! $KB020!:!$88! 2R! exp O86O;O8S!,O87OfO8! 2RC8! expm1 O86O;OfS!,O87OfOf! 2R6! exp2 O86O;O6S!,O87OfO6! 2R6C8! exp2m1 O86O;O8=S!,O87OfO8=! 2R87! exp10 O86O;O89S!,O87OfO89! 2R87C8! exp10m1 O86O;O8;S!,O87OfO8;! K4L! log O8
30、6O;OS!,O87OfO! K4L6! log2 O86O;O87S!,O87OfO87! K4L87! log10! O86O;OFS!,O87OfOF! K4LR8! log1pS!logp1 O86O;OS!,O87OfO! K4L6R8! log2p1 O86O;O8S!,O87OfO8! K4L87R8! log10p1 O86O;O8FS!,O87OfO8F! MTR41! hypot O86OOfS!,O87O=Of! /*V/1! rsqrt! O86OO;S!,O87O=O;! A4CR4B53! compoundn! O86OOS!,O87O=O! /4415! root
31、n O86OOFS!,O87O=OF! R4Q5! pown O86OOS!,O87O=O! R4Q! pow O86OO=S!,O87O=O=! R4Q/! powr O86OO87S!,O87O=O87! 0.5! sin O86O=O;S!,O87O8O;! A40! cos O86O=O9S!,O87O8O9! 15! tan! O86O=OS!,O87O8O! 0.5+.! sinpi! O86O=O8fS!,O87O8O8f! A40+.! cospi! O86O=O86S!,O87O8O86! ! tanpi! O86O=O8=S!,O87O8O8=! ! asinpi! O86
32、O=OS!,O87O8O! ! acospi! O86O=OFS!,O87O8OF! 15+.! atanpi! O86O=O87S!,O87O8O87! 156+.! atan2pi! O86O=O88S!,O87O8O88! 0.5! asin! O86O=O6S!,O87O8O6! A40! acos! O86O=O8S!,O87O8O8! 15! atan O86O=OfS!,O87O8Of! 156! atan2! O86O=O=S!,O87O8O=! 0.5M! sinh! O86O9O9S!,O87O6O9! A40M! cosh! O86O9O=S!,O87O6O=! 15M!
33、 tanh! O86O9O;S!,O87O6O;! 0.5M! asinh! O86O9O6S!,O87O6O6! A40M! acosh O86O9O8S!,O87O6O8! PD ISO/IEC TS 18661-4:2015“#$%“! “M.0!AK! X*+X.X2!)?=!acospi+6E5; double acospi(double x); float acospif(float x); long double acospil(long double x); _FloatP acospifP(_FloatP x); _FloatPx acospifPx(_FloatPx x);
34、 _DecimalP acospidP(_DecimalP x); _DecimalPx acospidPx(_DecimalPx x); U=F8L;75! n6o!“M2!acospi!B5A1.450!A4CRB12!1M2!R/.5A.RK!NKB2!4!1M2!/A!A40.52!4!xS!3.N.323!DT!QS!1MB0! C20B/.5L!1M2!5LK2!.5!MK:/2N4KB1.450O!(!34C.5!2/4/!4AAB/0!4/!/LBC2510!541!.5!1M2! .512/NK!nr8S!Z8oO! S=;E85F! nfo!“M2!acospi!B5A1.
35、450!/21B/5!/AA40Gx)/QS!.5!1M2!.512/NK!n7S!8oO! PD ISO/IEC TS 18661-4:2015! ! ! ! !“#$%“ double asinpi(double x); float asinpif(float x); long double asinpil(long double x); _FloatP asinpifP(_FloatP x); _FloatPx asinpifPx(_FloatPx x); _DecimalP asinpidP(_DecimalP x); _DecimalPx asinpidPx(_DecimalPx x
36、); U=F8; double atanpi(double x); float atanpif(float x); long double atanpil(long double x); _FloatP atanpifP(_FloatP x); _FloatPx atanpifPx(_FloatPx x); _DecimalP atanpidP(_DecimalP x); _DecimalPx atanpidPx(_DecimalPx x); U=F8L;75! n6o!“M2!atanpi!B5A1.450!A4CRB12!1M2!R/.5A.RK!NKB2!4!1M2!/A!15L251!
37、4!xS!3.N.323!DT!QS! 1MB0!C20B/.5L!1M2!5LK2!.5!MK:/2N4KB1.450O!(!/5L2!2/4/!4AAB/0!.!1M2!CL5.1B32!4!545U2/4! x!.0!144!0CKKO! S=;E85F! nfo!“M2!atanpi!B5A1.450!/21B/5!/A15GxH!E!QS!.5!1M2!.512/NK!nr8E6S!Z8E6oO! PD ISO/IEC TS 18661-4:2015“#$%“ double atan2pi(double y, double x); float atan2pif(float y, fl
38、oat x); long double atan2pil(long double y, long double x); _FloatP atan2pifP(_FloatP y, _FloatP x); _FloatPx atan2pifPx(_FloatPx y, _FloatPx x); _DecimalP atan2pidP(_DecimalP y, _DecimalP x); _DecimalPx atan2pidPx(_DecimalPx y, _DecimalPx x); U=F8; double cospi(double x); float cospif(float x); lon
39、g double cospil(long double x); _FloatP cospifP(_FloatP x); _FloatPx cospifPx(_FloatPx x); _DecimalP cospidP(_DecimalP x); _DecimalPx cospidPx(_DecimalPx x); U=F8L;75! n6o!“M2!cospi!B5A1.450!A4CRB12!1M2!A40.52!4!Q!s!xS!1MB0!/2L/3.5L!x!0!C20B/2C251!.5! MK:/2N4KB1.450O! S=;E85F! nfo!“M2!cospi!B5A1.450
40、!/21B/5!A40GQ!s!xHO! PD ISO/IEC TS 18661-4:2015! ! ! ! !“#$%“ double sinpi(double x); float sinpif(float x); long double sinpil(long double x); _FloatP sinpifP(_FloatP x); _FloatPx sinpifPx(_FloatPx x); _DecimalP sinpidP(_DecimalP x); _DecimalPx sinpidPx(_DecimalPx x); U=F8; double tanpi(double x); float tanpif(float x); long double tanpil(long double x); _FloatP tanpifP(_FloatP x); _FloatPx tanpifPx(_FloatPx x); _DecimalP tanpidP(_DecimalP x); _DecimalPx tanpidPx(_DecimalPx x); U=F8! X*+X3X0!)?=!log1p+6E5;75F! PD ISO/IEC TS 18661-4:2015