新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     >>W3CHINA.ORG讨论区<<     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 最新的技术动态
    [返回] W3CHINA.ORG讨论区 - 语义网·描述逻辑·本体·RDF·OWL休息区『 最新动态 & 业界新闻 』 → AMD Athlon 64 Processor 2800+ 1.8G CUP的浮点运算有问题吗? 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4220 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: AMD Athlon 64 Processor 2800+ 1.8G CUP的浮点运算有问题吗? 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     zhishushinv 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:61
      门派:XML.ORG.CN
      注册:2007/7/18

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给zhishushinv发送一个短消息 把zhishushinv加入好友 查看zhishushinv的个人资料 搜索zhishushinv在『 最新动态 & 业界新闻 』的所有贴子 引用回复这个贴子 回复这个贴子 查看zhishushinv的博客楼主
    发贴心情 AMD Athlon 64 Processor 2800+ 1.8G CUP的浮点运算有问题吗?

    用MATLAB计算PADE逼近问题,在AMD Athlon 64 Processor 2800+ 1.8G CUP上的
    计算结算结果如下:
    Numerator odder   N = 9
    Denominator Order M = 10
    KR =
              -118.741401899848 -      141.303692321582i
              -118.741401899848 +      141.303692321582i
               4655.36084642569 -       1.9017730325562i
               4655.36084642563 +      1.90177303245851i
              -28916.5722700037 +      18169.1850996911i
              -28916.5722700013 -      18169.1850996965i
               61276.9997060647 -      95408.5989092897i
               61276.9997060445 +      95408.5989092861i
              -36902.0468804896 +      196990.463527646i
              -36902.0468804889 -       196990.46352765i
    ZP =
               5.22545336734372 +      15.7295290456393i
               5.22545336734372 -      15.7295290456393i
               8.77643464008686 +      11.9218538982971i
               8.77643464008686 -      11.9218538982971i
               10.9343034305925 +      8.40967299602313i
               10.9343034305925 -      8.40967299602313i
               12.2261314841662 +      5.01271926363477i
               12.2261314841662 -      5.01271926363477i
               12.8376770778108 +      1.66606258421723i
               12.8376770778108 -      1.66606258421723i

    用INTEL CPU计算的结果如下:
    Numerator odder   N = 9
    Denominator Order M = 10
    KR =
              -118.741401899714 -      141.303692321858i
              -118.741401899714 +      141.303692321859i
               4655.36084639595 -      1.90177306286648i
               4655.36084639598 +      1.90177306348351i
              -28916.5722705105 +      18169.1850997184i
              -28916.5722705106 -      18169.1850997126i
               61276.9997056489 -      95408.5989085931i
               61276.9997056478 +      95408.5989085995i
              -36902.0468796215 +      196990.463527742i
              -36902.0468795457 -      196990.463527748i
    ZP =
               5.22545336734481 +      15.7295290456402i
               5.22545336734481 -      15.7295290456402i
               8.77643464007705 +      11.9218538982961i
               8.77643464007705 -      11.9218538982961i
               10.9343034306161 +      8.40967299601561i
               10.9343034306161 -      8.40967299601561i
               12.2261314841436 +       5.0127192636517i
               12.2261314841436 -       5.0127192636517i
               12.8376770778184 +      1.66606258420292i
               12.8376770778184 -      1.66606258420292i
    显然,后几位有效数字不相同。在几台不同的INTEL CPU上计算得到的结果都相同。但手中只有一台AMD计算机,无法在不同AMD机之间比较,所以也不能结论说AMD浮点运算误差大,而且业界普遍认为AMD浮点运算超强。故敬请有AMD的大虾帮忙难验证一下,下面是MATLAT原码:
    function YutouPADE
    % =========================================================================
    % YUTOUNILT M-file for calulation of Pade approximation
    % Note: Pade approximation
    %    
    %         exp(z) = Pade(z) = N(z)/M(z) = sum( Ki/(z-pi)
    %         N(z) = bn*z^n + bn-1*z^n-1 + ... + b1*z + b0
    %         M(z) = am*z^m + am-1*z^m-1 + ... + a1*z + a0
    %
    % Last Modified by YuTou v2.5 17-Jul-2007 23:23:28
    % =========================================================================
    % ----- Direct commands for format dispaly of the results ----
        clc
        format long g
        format compact
    % -----
        N = input( 'Numerator odder   N = ' );
        M = input( 'Denominator Order M = ' );
    % If you just press the key ENTER, the default value is M=10 and N=9
        if isempty(M) || isempty(N)
            M = 10;
            N = 9;
            disp( 'You do not enter any number. System sets M=10 and N=9' );
        end
    % Coefficients of Polynomial N(z) and M(z)  
        BN = zeros( 1, N+1 );
        AM = zeros( 1, M+1 );
        IM = [ M :-1 : 0 ];
        IN = [ N :-1 : 0 ];
    % Multiplicity 1E-5 is just for accuracy
        NF = factorial( N ) .* 1E-5;  
        MF = factorial( M ) .* 1E-5;
        for I = 1 : M+1
            TEMP = [ M-IM(I)+1 : M-IM(I)+N ];
            AM(I) = PowerNegOne( I ) .* prod( TEMP )  .* 1E-5 .* ( MF./factorial(IM(I)) );
            %AM(I) = ((-1)^I) .* factorial( M+N-IM(I) ) .* nchoosek( M, IM(I) );
            %AM(I) = ((-1)^I)*factorial(M+N-IM(I))/factorial(M-IM(I))/factorial(IM(I))*MF;
            %AM(I) = ((-1)^I)*factorial(M+N-IM(I))*MF/( factorial(M-IM(I))*factorial(IM(I)) );
        end
        for I = 1 : N+1
            TEMP = [ N-IN(I)+1 : N-IN(I)+M ];
            BN(I) = prod( TEMP ) .* 1E-5 .* ( NF./factorial(IN(I)) );
            %BN(I) = factorial( M+N-IN(I) ) .* nchoosek( N, IN(I) );
            %BN(I) = factorial(M+N-IN(I))*NF/( factorial(N-IN(I))*factorial(IN(I)) );
            %TempStr = [ TempStr; sprintf('%32.30g', BN(I)) ];
        end
    % Coefficients of the Partial fractional: KR is resdues and ZP poles
        [ KR, ZP, KK ]= residue( BN, AM );
        KR
        ZP
        
        
    % --------------------------------------------------
    function R = PowerNegOne( I )
        if rem( I, 2 ) > 0
            R = -1;
        else
            R = 1;
        end


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/7/18 23:23:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 最新动态 & 业界新闻 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/12/22 8:03:27

    本主题贴数1,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    5,394.531ms