Delphi 需要让我的代码更快。在布尔值数组中存储重复语句的结果

Delphi 需要让我的代码更快。在布尔值数组中存储重复语句的结果,delphi,optimization,Delphi,Optimization,我的项目处理历史和实时数据分析。在其最后阶段包含几个复杂的算法(超过800个)。总体而言,分析阶段大致如下: 基本公式计算->结果存储 使用上述公式的第二阶段公式->结果存储 决定所需行动的第三阶段公式 这些第三阶段公式是大量复杂条件。但是,这些复杂的条件语句使用有限数量的简单语句。结果,这些简单的语句在复杂的条件语句中重复了很多次。让我给你一个大大简化的例子 if ((var1[0]<var2[0]*0.5)and(var3[0]=1))or(var15[1]<>var15[

我的项目处理历史和实时数据分析。在其最后阶段包含几个复杂的算法(超过800个)。总体而言,分析阶段大致如下:

  • 基本公式计算->结果存储
  • 使用上述公式的第二阶段公式->结果存储
  • 决定所需行动的第三阶段公式
  • 这些第三阶段公式是大量复杂条件。但是,这些复杂的条件语句使用有限数量的简单语句。结果,这些简单的语句在复杂的条件语句中重复了很多次。让我给你一个大大简化的例子

    if ((var1[0]<var2[0]*0.5)and(var3[0]=1))or(var15[1]<>var15[0]))
    ....lots of similar statements....
    then take action.
    
    代码中的这些更改会加快执行(计算)时间吗?或者编译器已经做了类似的事情,我只是在浪费时间?请记住,在每个计算周期中,这些简单语句会重复数十次或数百次。在实时数据输入之前,至少要计算300000个周期。所以,每一点都有帮助。本质上,我是在问变量之间的比较是否比检索布尔数组元素的值慢

    更新

    因为有些人要求一些真实的代码,这里是真实代码的一部分。98%的代码是变量(所有带有[0]的代码都是允许访问以前的变量值的变量)。2%是功能。变量在前一阶段计算。几乎所有变量都是整数。总共有800多个类似的街区。至少300000个计算周期。平均时间约为45秒。由于我不需要在这里解释的原因,我应该让它快2倍。如果编写算法的人是程序员,那么代码的形式可能不同。但事实并非如此。它们最多可以处理一些基本的东西,比如条件块。这是无法改变的

    我注意到有些人带着讽刺的心情来到这里。请走开。我不需要你的帮助。我们非常欢迎愿意提供建设性意见的人这样做。事实上,我提前感谢他们为阅读这么长的帖子而付出的努力。我为错误的代码格式感到抱歉,将其作为代码发布到此处是一次失败的尝试

    if   ( ZEChT01Pc[0] < ZEChT02Pc[0])
    and( ZEChP01Pc[0] < ZEChP02Pc[0])
    and( ZEChT01Bn[0] > ZEChP01Bn[0])
    and( BncUp_TL_P_1_2[0] > ZEChT01Bn[0])
    and( higSncZEChT01[0] < HZigCh30[0])
    and( ((ZEChT01Pc[0] < LZigCh30[0]) )
         or
           ( (ZEChT01Pc[0] < LZigCh3002[0] )    and( LZigCh30[0] < LZigCh3002[0] )    and( ZEChT01Pc[0] <= Bnc_Up_HZigCh_Pr[0]) )
           or
           ( (ZEChT01Pc[0] < LZigCh3002[0] )    and( LZigCh30[0] < LZigCh3002[0] )    and( ZEChT01Pc[0] > Bnc_Up_HZigCh_Pr[0] )    and( ZEChP02Pc[0] < TFZ11EndPc[0])) )
    and( ((TL_Pks_1_2.tl_getvalue(0) < LZigCh30[0] + ((HZigCh30[0] - LZigCh30[0] )*0.80)) )
         or
           ( (ZEChT01Pc[0] < ULX2dly[0] )    and( C[0] > DLX2dly[0])) )
    and (( (ZECoP01Bn[0] > ZEChP01Bn[0])    and (ZECoP01Bn[0] < ZEChT01Bn[0])
    and (( (ZECoP01Pc[0] <= ZECoP02Pc[0])    and (C[0] > TL_ECo_Trs_1_2.tl_getvalue(0) )) or ( (ZECoP01Pc[0] > ZECoP02Pc[0]) )) )
         or
       ( (ZECoP01Bn[0] = ZEChP01Bn[0])    and (ZECoP02Bn[0] < ZEChT02Bn[0])  ))
    and (( (C[0] > ULX30[0])    and (C[1] <= ULX30[0])    and (ULX30[0] > TL_Pks_1_2.tl_getValue(0))
    and (( (BrUpULX30[1] < ZEchT01Bn[0]) ) or ( (chgZigLCh[0] > BrUpULX30[1]) )) )
         or
         ( (C[0] > TL_Pks_1_2.tl_getvalue(0))    and (C[1] <= TL_Pks_1_2.tl_getvalue(0))    and ( TL_Pks_1_2.tl_getValue(0) > ULX30[0])    and (BncUp_TL_P_1_2[1] < ZEchT01Bn[0]) ))
    and( ((uniBrUpULX3002_bn[0] > ZEChT01Bn[0] )    and( uniBrUpULX30[0] > TL_Pks_1_2.tl_getvalue(0) )    and( uniBrUpULX3002[0] < TL_Pks_1_2.tl_getvalue(0)) )= false)
    and( ((uniBrUpULX3002_bn[0] > ZEChT01Bn[0] )    and( uniBrUpULX30[0] > TL_Pks_1_2.tl_getvalue(0) )    and( uniBrUpULX3002[0] > TL_Pks_1_2.tl_getvalue(0)) )= false)
    and( NoLong[0] = 0)
    and( ((TL_Pks_1_2.tl_getvalue(0) < LZigCh30[0] )    and( chgZigLCh[0] < ZEChT01Bn[0] )    and( ULX30[0] > LZigCh30[0]) )= false)
    and( ((((C[0] < DLXdly[0] )    and( HZigCh30[0] < DLXdly[0] - Tk(0.0050)) = false)))
          or
          ( (ZEChT01Bn[0] = TFZ10EndBnum[0] )    and( ZEChT01Pc[0] < TFZ20EndPc[0] )    and( higSncZEChT01[0] > TFZ40EndPc[0])) )
    and( ((ZEChP01Pc[0] > DLXdly[0] )    and( ZEChT01Pc[0] < DLXdly[0] )    and( HZigCh30[0] < DLXdly[0] )) = false)
    and( ((higSncZEChT01[0] > HZigCh30[0] -Tk(0.0010) )    and( Bnc_Dn_HZigCh[0]  > higbarSncZEChT01[0]) )= false)
    and( ((TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ10Type[0]= 5 )    and( TFZ10Extension[0] = 0 )    and( ULX30[0] < LZigCh30[0]) )= false)
    and( ((Bnc_Dn_LZigCh[0] > ZEChT01Bn[0] )    and( C[0] < LZigCh30[0]) )= false)
    and( ((ZEChP01Pc[0] > DLXdly[0] )    and( ZEChT01Pc[0] < DLXdly[0] )    and( C[0] < DLXdly[0] )    and( First[0] = -1) )= false)
    and( ((LZigCh3002[0] >  DLXdly[0] )    and( LZigCh30[0] <  DLXdly[0] )    and( C[0] < DLXdly[0])    and( HZigCh3002[0] >  DLXdly[0] )    and( HZigCh30[0] <  DLXdly[0] )) = false)
    and( ((LZigCh3003[0] >  DLXdly[0] )    and( LZigCh3002[0] <  DLXdly[0] )    and( C[0] < DLXdly[0])
    and( HZigCh3002[0] >  DLXdly[0] )    and( HZigCh30[0] <  DLXdly[0] )    and( LZigCh30[0] < DLXdly[0] )    and( currentbar - chgZigLCh[0] <= 3 )) = false)
    and( ((((TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( C[0] > higSncShFrm[0]  - ((higSncShFrm[0] - TFZ10EndPc[0])*0.5) )    and( higBarSncShFrm[0] <= ZEChP02Bn[0]) = false)))
         or
         ( (ZEChT01Pc[0] < DLXdly[0] )    and( C[0] > DLXdly[0])) )
    and( ((C[0] <= LZigCh30[0] )    and( H[0] > LZigCh30[0]) = false))
    and( ((ZEChT01Pc[0] < ULXdly[0] )    and( ZEChT02Pc[0] < ULXdly[0] )    and( ZEChP01Pc[0] > ULXdly[0] )
    and( ZEChP02Pc[0] > ULXdly[0] )    and( ZEChT01Pc[0] < ZEChT02Pc[0])    and  (BncUpDLXdly[0] < ZEchT01Bn[0]) )= false)
    and( ((((TFZ11EndBnum[0] > TFZ10EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ10EndPc[0])*0.382)) = false)))
          or
          ( (C[0] > ULXdly[0])) )
    and( ((((TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ20EndBnum[0] < TFZ11EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ20EndPc[0])*0.382)) )= false))
          or
          ( (C[0] > ULXdly[0])) )
    and( ((((TFZ20EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ30EndBnum[0] < TFZ11EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ30EndPc[0])*0.382)) )= false))
          or
          ( (C[0] > ULXdly[0])))
    and( ((((TFZ30EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ40EndBnum[0] < TFZ11EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ40EndPc[0])*0.382)) )= false))
          or
          ( (C[0] > ULXdly[0])))
    and( ((ZEChP01Pc[0] > ZEChP03Pc[0] )    and( ZEChP01Pc[0] > ZEChP04Pc[0]  )    and( C[0] < DLXdly[0]) = false) )
    and (( (( (LZigCh30[0] < DLXdly[0] )    and( LZigCh3002[0] > DLXdly[0] )    and( ZEChP01Pc[0] < DLXdly[0] )    and( C[0] < DLXdly[0]) ) = false))
          or
          ( (ZEchT01Pc[0] = TFZ10EndPc[0]) or (ZEchT02Pc[0] = TFZ20EndPc[0]) or (ZEchT03Pc[0] = TFZ30EndPc[0]) ))
    and( NoLong2[0] = 0 )
    and( ((ZEChP02Pc[0] > ULX2dly[0] )    and( ZEChP01Pc[0] < ULXdly[0] )    and( C[0] < ULX2dly[0] )    and( BrDnDLXdly[0] < BrUpULXdly[0])
    and( Min(ZEChT01Pc[0],ZEChT02Pc[0]) > ULXdly[0] - ((ULXdly[0] - DLXdly[0]) * 0.618)) )= false)
    and( ((BrDnDLXdly[0] < BrUpULXdly[0] )    and( Min(ZEChT01Pc[0],ZEChT02Pc[0]) > ULXdly[0] - ((ULXdly[0] - DLXdly[0]) * 0.4))
    and( TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( C[0] < ULX2dly[0] )    and( ULXdly[0] > ULX2dly[0] ) )= false)
    and( ((BrDnDLXdly[0] < BrUpULXdly[0] )    and( TFZ10EndPc[0]  > ULXdly[0] - ((ULXdly[0] - DLXdly[0]) * 0.4))
    and( TFZ10EndBnum[0] < TFZ11EndBnum[0] )    and( C[0] < ULX2dly[0] )    and( ULXdly[0] > ULX2dly[0] ) )= false)
    and( ((ZEChP02Pc[0] > ULX2dly[0] )    and( ZEChP01Pc[0] < ULXdly[0] )    and( C[0] < ULX2dly[0] )    and( BrDnDLXdly[0] < BrUpULXdly[0])
    and( C[0] > LZigCh30[0] + ((HZigCh30[0] - LZigCh30[0]) * 0.768) )    and( C[0] < ULX2dly[0]) )= false)
    and( ((LZigCh30[0] < DLXdly[0] )    and( DLXdly[0] < HZigCh30[0] )    and( C[0] > LZigCh30[0] + ((DLXdly[0] - LZigCh30[0])*0.618))
    and( DLXdly[0] - C[0]  < Tk(0.0040) )    and( C[0] < DLXdly[0] ) )= false)
    and( ((((ZEChT01Bn[0] <> TFZ10EndBnum[0] )    and( ZEChT01Pc[0] >= LZigCh30[0])) = false))
          or
          ( (ZEChT01Pc[0] < LZigCh30[0] )    and( C[0] > LZigCh30[0] )    and( LZigCh30[0] > ULXdly[0]))
          or
          ( (LZigCh30[0] < LZigCh3002[0] )    and( chgZigLCh[0] > ZEChT01Bn[0] )    and( ZEChP01Pc[0] < LZigCh3002[0] )    and( C[0] > ZEChT02Pc[0] ) )
          or
          ( (ZEChT01Pc[0] <= DLXdly[0] )    and( C[0] > DLXdly[0])))
    and( ((C[0] < TFZ20EndPc[0] )    and( C[0] < LZigCh3002[0] )    and( TFZ20Type[0] > 3 )    and( ((TFZ20EndBnum[0] = ZEChT02Bn[0]) )or( (TFZ20EndBnum[0] = ZEChT03Bn[0]))) )= false)
    and( ((((ZEChT01Bn[0] <> TFZ10EndBnum[0] )    and( ZEChT01Pc[0] < LZigCh30[0] )    and( LZigCh30[0] > ULXdly[0]) )= false))
          or
          ( (C[0] < LZigCh30[0] + ((HZigCh30[0] - LZigCh30[0] )*0.618) )    and( HZigCh30[0] - C[0] >= Tk(0.0040)) ))
    and( ((LZigCh30[0] < DLXdly[0] )    and( LZigCh3002[0] > DLXdly[0] )    and( ZEChP02Pc[0] < DLXdly[0] + Tk(0.0050) )
    and( ZEChP02Pc[0] < LZigCh3002[0] )    and( C[0] < LZigCh3002[0] ) = false))
    and ( (( (HZigCh30[0] < DLXdly[0])    and (HZigCh3002[0] > DLXdly[0])    and (ZEchT01Bn[0] = TFZ10EndBnum[0])
    and (TFZ10Type[0] = 5 )    and (TFZ10Extension[0] = 0)    and (DLXdly[0] < DLX2dly[0]) ) = false) )
    and (( (( (chgULXdly[0] > ZEchP01Bn[0])    and (ULXdly[0] > ULX2dly[0])    and (C[0] < ULXdly[0])    and (ZEchT01Pc[0] > ULX2dly[0]) )=false))
          or
          ( (TFZ10EndBnum[0] = ZEchT01Bn[0])    and (TFZ10Type[0] > 3) ))
    and (( (( (chgULXdly[0] > ZEchP01Bn[0])    and (ULXdly[0] > ULX2dly[0])    and (C[0] < ULXdly[0])    and (C[0] < ULX2dly[0]))= false))
        or
        ( ( ZechT01Pc[0] < ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.75))    and (C[0] > LZigCh30[0])    and (DLX30[0] > LZigCh30[0]) ))
    and (( (( (chgULXdly[0] > ZEchP01Bn[0])    and (ULXdly[0] < ULX2dly[0])    and (C[0] < ULXdly[0]) ) = false))
           or
           ( ( ZechT01Pc[0] < ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.75))    and (C[0] > LZigCh30[0])    and (DLX30[0] > LZigCh30[0]) ))
    and (( (TFZ11EndBnum[0] = ZEchP02Bn[0])    and (TFZ11Type[0] > 3)    and (min(ZEchT01Pc[0],ZechT02Pc[0]) = TFZ10EndPc[0])    and (C[0] < ULXdly[0])
    and (TFZ10Type[0] = 3)    and (TFZ10Extension[0] = 2)    and (TFZ10EndPc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.5)) ) = false)
    and (( (TFZ11EndBnum[0] = ZEchP02Bn[0])    and (TFZ11Type[0] > 3)    and (min(ZEchT01Pc[0],ZechT02Pc[0]) = TFZ10EndPc[0])    and (C[0] < ULXdly[0])
    and (( (TFZ10Type[0] = 3)    and (TFZ10Extension[0] = 2) )= false)    and (TFZ10EndPc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.8)) ) = false)
    and (( (( (TFZ11EndBnum[0] = ZEchP02Bn[0])    and (TFZ11Type[0] > 3)    and (min(ZEchT01Pc[0],ZechT02Pc[0]) <> TFZ10EndPc[0])) = false))
         or
         ( (min(ZEchT01Pc[0],ZechT02Pc[0]) < ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.8)) )
         or
         ( (Bnc_Up_LZigCh[0] > ZEchT01Bn[0])    and (ZEchT01Pc[0] > ZechP03Pc[0]) ))
    and (( (ZechT01Pc[0] < ZechT02Pc[0])    and (ZechP01Pc[0] < ZechP02Pc[0])    and (ZEchT01Pc[0] > ULXdly[0])    and (C[0] < ZEchT02Pc[0])    and (C[0] > ULXdly[0]) ) = false)
    and (( (ZechT01Pc[0] < ZechT02Pc[0])    and (ZechP01Pc[0] < ZechP02Pc[0])    and (ZEchT01Pc[0] > ULXdly[0])    and (ZEchP02Bn[0] = TFZ11EndBnum[0])
    and (ZEchT02Bn[0]= TFZ20EndBnum[0])    and (ZEchT01Bn[0]= TFZ10EndBnum[0])    and (TFZ10Type[0] = 3)    and (C[0] > ULXdly[0]) )= false)
    and (( (ZechT01Pc[0] < ZechT02Pc[0])    and (ZechP01Pc[0] < ZechP02Pc[0])    and (ZEchT01Pc[0] > ULXdly[0])    and (ZEchP03Bn[0] = TFZ11EndBnum[0])
    and (ZEchT02Bn[0]= TFZ20EndBnum[0])    and (ZEchT01Bn[0]= TFZ10EndBnum[0])    and (TFZ10Type[0] = 3)    and (C[0] > ULXdly[0]) )= false)
    and (((( (TFZ10Type[0] = 7)    and (TFZ20type[0] = 5)    and (TFZ10Extension[0] = 0)    and (TFZ20Extension[0] = 0)    and (TFZ10EndPc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.5))) = false))
          or
          ( (C[0] > ULXdly[0]) ) or ( (ZechT01Pc[0] < ULX2dly[0] )    and (C[0] > ULX2dly[0])    and (ULX2dly[0] < ULXdly[0]) ))
    and (( (max(HZigCh30[0],HZigCh3002[0]) - LZigCh30[0] < Tk(0.0100))    and (C[0] > LZigCh30[0] + ((max(HZigCh30[0],HZigCh3002[0]) - LZigCh30[0])*0.618)) ) = false)
    and (( (ZEchP02Pc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.236))    and (ZEchT01Bn[0] <> TFZ10EndBnum[0])    and (BncUpDLXdly[0] < ZEchT01Bn[0])) = false)
    and (( (Bnc_Dn_LZigCh[0] > ZEChT01Bn[0] )    and (C[0] < LZigCh30[0]) ) = false)
    and (( (TFZ41EndBnum[0] > TFZ10EndBnum[0])    and (C[0] < ULXdly[0])    and  (BncUpDLXdly[0] < ZEchT01Bn[0]) ) = false)
    and ( GenL01[0] = false)
    and ( GenL02[0] = false)
    and ( GenL03[0] = false)
    and ( GenL04[0] = True)
    then    
    
    if(ZEChT01Pc[0]ZEChP01Bn[0])
    和(BncUp_TL_P_1_2[0]>ZEChT01Bn[0])
    和(HigsnChechT01[0]DLX2DY[0]))
    (ZECoP01Bn[0]>ZEChP01Bn[0])和(ZECoP01Bn[0]ZECoP02Pc[0]))
    或
    ((ZECoP01Bn[0]=ZEChP01Bn[0])和(ZECoP02Bn[0]ULX30[0])和(C[1]TL_Pks_1_2.TL_getValue(0))
    和((BrUpULX30[1]BrUpULX30[1]))
    或
    ((C[0]>TL_Pks_1_2.TL_getvalue(0))和(C[1]ULX30[0])和(BncUp_TL_P_1_2[1]ZEChT01Bn[0])和(uniBrUpULX30[0]>TL_Pks_1_2.TL_getvalue(0))和(uniBrUpULX3002[0]ZEChT01Bn[0])和(uniBrUpULX30[0]>TL_Pks_1_2.TL_getvalue(0))和(uniBrUpULX3002[0]>TL_Pks_1_2.TL_getvalue(0))=false)
    和(NoLong[0]=0)
    和((TL_Pks_1_2.TL_getvalue(0)LZigCh30[0])=false)
    和(((C[0]TFZ40EndPc[0]))
    和((ZEChP01Pc[0]>DLXdly[0])和(ZEChT01Pc[0]HZigCh30[0]-Tk(0.0010))和(Bnc_Dn_HZigCh[0]>higSncZEChT01[0])=false)
    和((TFZ10EndBnum[0]>TFZ11EndBnum[0])和(TFZ10Type[0]=5)和(TFZ10Extension[0]=0)以及(ULX30[0]ZEChT01Bn[0])和(C[0]DLXdly[0])和(ZEChT01Pc[0]DLXdly[0])和(LZigCh30[0]DLXdly[0])和(HZigCh30[0]DLXdly[0])和(LZigCh3002[0]DLXdly[0])和(HZigCh30[0]higSncShFrm[0]((higSncShFrm[0]-TFZ10EndPc[0])*0.5)和(higsbarsncshfrm[0]DLXdly[0]))
    和((C[0]LZigCh30[0])=false))
    和((ZEChT01Pc[0]ULXdly[0])
    和(ZEChP02Pc[0]>ULXdly[0])和(ZEChT01Pc[0]TFZ10EndBnum[0])和(ZEChT01Pc[0]>TFZ11EndPc[0]-((TFZ11EndPc[0]-TFZ10EndPc[0])*0.382))=false)
    或
    ((C[0]>ULXdly[0]))
    和(((TFZ10EndBnum[0]>TFZ11EndBnum[0])和(TFZ20EndBnum[0]TFZ11EndPc[0]-((TFZ11EndPc[0]-TFZ20EndPc[0])=false))
    或
    ((C[0]>ULXdly[0]))
    和(((TFZ20EndBnum[0]>TFZ11EndBnum[0])和(TFZ30EndBnum[0]arr[12]:=var1[0]<var2[0]*0.5;
    arr[13]:=var3[0]=1;
    ...
    arr[128]:=var15[1]<>var15[0];
    
    if ((var1[0]<var2[0]*0.5)and(var3[0]=1))or(var15[1]<>var15[0]))
    
    if ((arr[12])and(arr[13]))or(arr[128])
    
    if   ( ZEChT01Pc[0] < ZEChT02Pc[0])
    and( ZEChP01Pc[0] < ZEChP02Pc[0])
    and( ZEChT01Bn[0] > ZEChP01Bn[0])
    and( BncUp_TL_P_1_2[0] > ZEChT01Bn[0])
    and( higSncZEChT01[0] < HZigCh30[0])
    and( ((ZEChT01Pc[0] < LZigCh30[0]) )
         or
           ( (ZEChT01Pc[0] < LZigCh3002[0] )    and( LZigCh30[0] < LZigCh3002[0] )    and( ZEChT01Pc[0] <= Bnc_Up_HZigCh_Pr[0]) )
           or
           ( (ZEChT01Pc[0] < LZigCh3002[0] )    and( LZigCh30[0] < LZigCh3002[0] )    and( ZEChT01Pc[0] > Bnc_Up_HZigCh_Pr[0] )    and( ZEChP02Pc[0] < TFZ11EndPc[0])) )
    and( ((TL_Pks_1_2.tl_getvalue(0) < LZigCh30[0] + ((HZigCh30[0] - LZigCh30[0] )*0.80)) )
         or
           ( (ZEChT01Pc[0] < ULX2dly[0] )    and( C[0] > DLX2dly[0])) )
    and (( (ZECoP01Bn[0] > ZEChP01Bn[0])    and (ZECoP01Bn[0] < ZEChT01Bn[0])
    and (( (ZECoP01Pc[0] <= ZECoP02Pc[0])    and (C[0] > TL_ECo_Trs_1_2.tl_getvalue(0) )) or ( (ZECoP01Pc[0] > ZECoP02Pc[0]) )) )
         or
       ( (ZECoP01Bn[0] = ZEChP01Bn[0])    and (ZECoP02Bn[0] < ZEChT02Bn[0])  ))
    and (( (C[0] > ULX30[0])    and (C[1] <= ULX30[0])    and (ULX30[0] > TL_Pks_1_2.tl_getValue(0))
    and (( (BrUpULX30[1] < ZEchT01Bn[0]) ) or ( (chgZigLCh[0] > BrUpULX30[1]) )) )
         or
         ( (C[0] > TL_Pks_1_2.tl_getvalue(0))    and (C[1] <= TL_Pks_1_2.tl_getvalue(0))    and ( TL_Pks_1_2.tl_getValue(0) > ULX30[0])    and (BncUp_TL_P_1_2[1] < ZEchT01Bn[0]) ))
    and( ((uniBrUpULX3002_bn[0] > ZEChT01Bn[0] )    and( uniBrUpULX30[0] > TL_Pks_1_2.tl_getvalue(0) )    and( uniBrUpULX3002[0] < TL_Pks_1_2.tl_getvalue(0)) )= false)
    and( ((uniBrUpULX3002_bn[0] > ZEChT01Bn[0] )    and( uniBrUpULX30[0] > TL_Pks_1_2.tl_getvalue(0) )    and( uniBrUpULX3002[0] > TL_Pks_1_2.tl_getvalue(0)) )= false)
    and( NoLong[0] = 0)
    and( ((TL_Pks_1_2.tl_getvalue(0) < LZigCh30[0] )    and( chgZigLCh[0] < ZEChT01Bn[0] )    and( ULX30[0] > LZigCh30[0]) )= false)
    and( ((((C[0] < DLXdly[0] )    and( HZigCh30[0] < DLXdly[0] - Tk(0.0050)) = false)))
          or
          ( (ZEChT01Bn[0] = TFZ10EndBnum[0] )    and( ZEChT01Pc[0] < TFZ20EndPc[0] )    and( higSncZEChT01[0] > TFZ40EndPc[0])) )
    and( ((ZEChP01Pc[0] > DLXdly[0] )    and( ZEChT01Pc[0] < DLXdly[0] )    and( HZigCh30[0] < DLXdly[0] )) = false)
    and( ((higSncZEChT01[0] > HZigCh30[0] -Tk(0.0010) )    and( Bnc_Dn_HZigCh[0]  > higbarSncZEChT01[0]) )= false)
    and( ((TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ10Type[0]= 5 )    and( TFZ10Extension[0] = 0 )    and( ULX30[0] < LZigCh30[0]) )= false)
    and( ((Bnc_Dn_LZigCh[0] > ZEChT01Bn[0] )    and( C[0] < LZigCh30[0]) )= false)
    and( ((ZEChP01Pc[0] > DLXdly[0] )    and( ZEChT01Pc[0] < DLXdly[0] )    and( C[0] < DLXdly[0] )    and( First[0] = -1) )= false)
    and( ((LZigCh3002[0] >  DLXdly[0] )    and( LZigCh30[0] <  DLXdly[0] )    and( C[0] < DLXdly[0])    and( HZigCh3002[0] >  DLXdly[0] )    and( HZigCh30[0] <  DLXdly[0] )) = false)
    and( ((LZigCh3003[0] >  DLXdly[0] )    and( LZigCh3002[0] <  DLXdly[0] )    and( C[0] < DLXdly[0])
    and( HZigCh3002[0] >  DLXdly[0] )    and( HZigCh30[0] <  DLXdly[0] )    and( LZigCh30[0] < DLXdly[0] )    and( currentbar - chgZigLCh[0] <= 3 )) = false)
    and( ((((TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( C[0] > higSncShFrm[0]  - ((higSncShFrm[0] - TFZ10EndPc[0])*0.5) )    and( higBarSncShFrm[0] <= ZEChP02Bn[0]) = false)))
         or
         ( (ZEChT01Pc[0] < DLXdly[0] )    and( C[0] > DLXdly[0])) )
    and( ((C[0] <= LZigCh30[0] )    and( H[0] > LZigCh30[0]) = false))
    and( ((ZEChT01Pc[0] < ULXdly[0] )    and( ZEChT02Pc[0] < ULXdly[0] )    and( ZEChP01Pc[0] > ULXdly[0] )
    and( ZEChP02Pc[0] > ULXdly[0] )    and( ZEChT01Pc[0] < ZEChT02Pc[0])    and  (BncUpDLXdly[0] < ZEchT01Bn[0]) )= false)
    and( ((((TFZ11EndBnum[0] > TFZ10EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ10EndPc[0])*0.382)) = false)))
          or
          ( (C[0] > ULXdly[0])) )
    and( ((((TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ20EndBnum[0] < TFZ11EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ20EndPc[0])*0.382)) )= false))
          or
          ( (C[0] > ULXdly[0])) )
    and( ((((TFZ20EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ30EndBnum[0] < TFZ11EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ30EndPc[0])*0.382)) )= false))
          or
          ( (C[0] > ULXdly[0])))
    and( ((((TFZ30EndBnum[0] > TFZ11EndBnum[0] )    and( TFZ40EndBnum[0] < TFZ11EndBnum[0] )    and( ZEChT01Pc[0] > TFZ11EndPc[0] - ((TFZ11EndPc[0] - TFZ40EndPc[0])*0.382)) )= false))
          or
          ( (C[0] > ULXdly[0])))
    and( ((ZEChP01Pc[0] > ZEChP03Pc[0] )    and( ZEChP01Pc[0] > ZEChP04Pc[0]  )    and( C[0] < DLXdly[0]) = false) )
    and (( (( (LZigCh30[0] < DLXdly[0] )    and( LZigCh3002[0] > DLXdly[0] )    and( ZEChP01Pc[0] < DLXdly[0] )    and( C[0] < DLXdly[0]) ) = false))
          or
          ( (ZEchT01Pc[0] = TFZ10EndPc[0]) or (ZEchT02Pc[0] = TFZ20EndPc[0]) or (ZEchT03Pc[0] = TFZ30EndPc[0]) ))
    and( NoLong2[0] = 0 )
    and( ((ZEChP02Pc[0] > ULX2dly[0] )    and( ZEChP01Pc[0] < ULXdly[0] )    and( C[0] < ULX2dly[0] )    and( BrDnDLXdly[0] < BrUpULXdly[0])
    and( Min(ZEChT01Pc[0],ZEChT02Pc[0]) > ULXdly[0] - ((ULXdly[0] - DLXdly[0]) * 0.618)) )= false)
    and( ((BrDnDLXdly[0] < BrUpULXdly[0] )    and( Min(ZEChT01Pc[0],ZEChT02Pc[0]) > ULXdly[0] - ((ULXdly[0] - DLXdly[0]) * 0.4))
    and( TFZ10EndBnum[0] > TFZ11EndBnum[0] )    and( C[0] < ULX2dly[0] )    and( ULXdly[0] > ULX2dly[0] ) )= false)
    and( ((BrDnDLXdly[0] < BrUpULXdly[0] )    and( TFZ10EndPc[0]  > ULXdly[0] - ((ULXdly[0] - DLXdly[0]) * 0.4))
    and( TFZ10EndBnum[0] < TFZ11EndBnum[0] )    and( C[0] < ULX2dly[0] )    and( ULXdly[0] > ULX2dly[0] ) )= false)
    and( ((ZEChP02Pc[0] > ULX2dly[0] )    and( ZEChP01Pc[0] < ULXdly[0] )    and( C[0] < ULX2dly[0] )    and( BrDnDLXdly[0] < BrUpULXdly[0])
    and( C[0] > LZigCh30[0] + ((HZigCh30[0] - LZigCh30[0]) * 0.768) )    and( C[0] < ULX2dly[0]) )= false)
    and( ((LZigCh30[0] < DLXdly[0] )    and( DLXdly[0] < HZigCh30[0] )    and( C[0] > LZigCh30[0] + ((DLXdly[0] - LZigCh30[0])*0.618))
    and( DLXdly[0] - C[0]  < Tk(0.0040) )    and( C[0] < DLXdly[0] ) )= false)
    and( ((((ZEChT01Bn[0] <> TFZ10EndBnum[0] )    and( ZEChT01Pc[0] >= LZigCh30[0])) = false))
          or
          ( (ZEChT01Pc[0] < LZigCh30[0] )    and( C[0] > LZigCh30[0] )    and( LZigCh30[0] > ULXdly[0]))
          or
          ( (LZigCh30[0] < LZigCh3002[0] )    and( chgZigLCh[0] > ZEChT01Bn[0] )    and( ZEChP01Pc[0] < LZigCh3002[0] )    and( C[0] > ZEChT02Pc[0] ) )
          or
          ( (ZEChT01Pc[0] <= DLXdly[0] )    and( C[0] > DLXdly[0])))
    and( ((C[0] < TFZ20EndPc[0] )    and( C[0] < LZigCh3002[0] )    and( TFZ20Type[0] > 3 )    and( ((TFZ20EndBnum[0] = ZEChT02Bn[0]) )or( (TFZ20EndBnum[0] = ZEChT03Bn[0]))) )= false)
    and( ((((ZEChT01Bn[0] <> TFZ10EndBnum[0] )    and( ZEChT01Pc[0] < LZigCh30[0] )    and( LZigCh30[0] > ULXdly[0]) )= false))
          or
          ( (C[0] < LZigCh30[0] + ((HZigCh30[0] - LZigCh30[0] )*0.618) )    and( HZigCh30[0] - C[0] >= Tk(0.0040)) ))
    and( ((LZigCh30[0] < DLXdly[0] )    and( LZigCh3002[0] > DLXdly[0] )    and( ZEChP02Pc[0] < DLXdly[0] + Tk(0.0050) )
    and( ZEChP02Pc[0] < LZigCh3002[0] )    and( C[0] < LZigCh3002[0] ) = false))
    and ( (( (HZigCh30[0] < DLXdly[0])    and (HZigCh3002[0] > DLXdly[0])    and (ZEchT01Bn[0] = TFZ10EndBnum[0])
    and (TFZ10Type[0] = 5 )    and (TFZ10Extension[0] = 0)    and (DLXdly[0] < DLX2dly[0]) ) = false) )
    and (( (( (chgULXdly[0] > ZEchP01Bn[0])    and (ULXdly[0] > ULX2dly[0])    and (C[0] < ULXdly[0])    and (ZEchT01Pc[0] > ULX2dly[0]) )=false))
          or
          ( (TFZ10EndBnum[0] = ZEchT01Bn[0])    and (TFZ10Type[0] > 3) ))
    and (( (( (chgULXdly[0] > ZEchP01Bn[0])    and (ULXdly[0] > ULX2dly[0])    and (C[0] < ULXdly[0])    and (C[0] < ULX2dly[0]))= false))
        or
        ( ( ZechT01Pc[0] < ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.75))    and (C[0] > LZigCh30[0])    and (DLX30[0] > LZigCh30[0]) ))
    and (( (( (chgULXdly[0] > ZEchP01Bn[0])    and (ULXdly[0] < ULX2dly[0])    and (C[0] < ULXdly[0]) ) = false))
           or
           ( ( ZechT01Pc[0] < ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.75))    and (C[0] > LZigCh30[0])    and (DLX30[0] > LZigCh30[0]) ))
    and (( (TFZ11EndBnum[0] = ZEchP02Bn[0])    and (TFZ11Type[0] > 3)    and (min(ZEchT01Pc[0],ZechT02Pc[0]) = TFZ10EndPc[0])    and (C[0] < ULXdly[0])
    and (TFZ10Type[0] = 3)    and (TFZ10Extension[0] = 2)    and (TFZ10EndPc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.5)) ) = false)
    and (( (TFZ11EndBnum[0] = ZEchP02Bn[0])    and (TFZ11Type[0] > 3)    and (min(ZEchT01Pc[0],ZechT02Pc[0]) = TFZ10EndPc[0])    and (C[0] < ULXdly[0])
    and (( (TFZ10Type[0] = 3)    and (TFZ10Extension[0] = 2) )= false)    and (TFZ10EndPc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.8)) ) = false)
    and (( (( (TFZ11EndBnum[0] = ZEchP02Bn[0])    and (TFZ11Type[0] > 3)    and (min(ZEchT01Pc[0],ZechT02Pc[0]) <> TFZ10EndPc[0])) = false))
         or
         ( (min(ZEchT01Pc[0],ZechT02Pc[0]) < ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.8)) )
         or
         ( (Bnc_Up_LZigCh[0] > ZEchT01Bn[0])    and (ZEchT01Pc[0] > ZechP03Pc[0]) ))
    and (( (ZechT01Pc[0] < ZechT02Pc[0])    and (ZechP01Pc[0] < ZechP02Pc[0])    and (ZEchT01Pc[0] > ULXdly[0])    and (C[0] < ZEchT02Pc[0])    and (C[0] > ULXdly[0]) ) = false)
    and (( (ZechT01Pc[0] < ZechT02Pc[0])    and (ZechP01Pc[0] < ZechP02Pc[0])    and (ZEchT01Pc[0] > ULXdly[0])    and (ZEchP02Bn[0] = TFZ11EndBnum[0])
    and (ZEchT02Bn[0]= TFZ20EndBnum[0])    and (ZEchT01Bn[0]= TFZ10EndBnum[0])    and (TFZ10Type[0] = 3)    and (C[0] > ULXdly[0]) )= false)
    and (( (ZechT01Pc[0] < ZechT02Pc[0])    and (ZechP01Pc[0] < ZechP02Pc[0])    and (ZEchT01Pc[0] > ULXdly[0])    and (ZEchP03Bn[0] = TFZ11EndBnum[0])
    and (ZEchT02Bn[0]= TFZ20EndBnum[0])    and (ZEchT01Bn[0]= TFZ10EndBnum[0])    and (TFZ10Type[0] = 3)    and (C[0] > ULXdly[0]) )= false)
    and (((( (TFZ10Type[0] = 7)    and (TFZ20type[0] = 5)    and (TFZ10Extension[0] = 0)    and (TFZ20Extension[0] = 0)    and (TFZ10EndPc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.5))) = false))
          or
          ( (C[0] > ULXdly[0]) ) or ( (ZechT01Pc[0] < ULX2dly[0] )    and (C[0] > ULX2dly[0])    and (ULX2dly[0] < ULXdly[0]) ))
    and (( (max(HZigCh30[0],HZigCh3002[0]) - LZigCh30[0] < Tk(0.0100))    and (C[0] > LZigCh30[0] + ((max(HZigCh30[0],HZigCh3002[0]) - LZigCh30[0])*0.618)) ) = false)
    and (( (ZEchP02Pc[0] > ULXdly[0] - ((ULXdly[0] - DLXdly[0])*0.236))    and (ZEchT01Bn[0] <> TFZ10EndBnum[0])    and (BncUpDLXdly[0] < ZEchT01Bn[0])) = false)
    and (( (Bnc_Dn_LZigCh[0] > ZEChT01Bn[0] )    and (C[0] < LZigCh30[0]) ) = false)
    and (( (TFZ41EndBnum[0] > TFZ10EndBnum[0])    and (C[0] < ULXdly[0])    and  (BncUpDLXdly[0] < ZEchT01Bn[0]) ) = false)
    and ( GenL01[0] = false)
    and ( GenL02[0] = false)
    and ( GenL03[0] = false)
    and ( GenL04[0] = True)
    then    
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      Result: Boolean;
      X: array [0..1] of Double;
      Y: array [0..1] of Double;
    begin
      X[0] := 0.25;
      X[1] := 0.75;
      Y[0] := 0.25;
      Y[1] := 0.75;
    
      if (X[0] < X[1] * 0.5) and (Y[0] < Y[1] * 0.5) then
        Result := True;
    
      if Result then
        ShowMessage('Result = True'); // to prevent optimization
    end;
    
    procedure TForm1.Button2Click(Sender: TObject);
    var
      Result: Boolean;
      X: array [0..1] of Double;
      Y: array [0..1] of Double;
      Z: array [0..1] of Boolean;
    begin
      X[0] := 0.25;
      X[1] := 0.75;
      Y[0] := 0.25;
      Y[1] := 0.75;
    
      Z[0] := (X[0] < X[1] * 0.5);
      Z[1] := (Y[0] < Y[1] * 0.5);
    
      if Z[0] and Z[1] then
        Result := True;
    
      if Result then
        ShowMessage('Result = True'); // to prevent optimization
    end;
    
    if (X[0] < X[1] * 0.5) and (Y[0] < Y[1] * 0.5) then
    -----------------------------------------------------
    fld    qword ptr [esp+$08]
    fmul   dword ptr [$0046cdbc]
    fcomp  qword ptr [esp]
    wait
    fstsw  ax
    sahf
    jbe    $0046cda7
    fld    qword ptr [esp+$18]
    fmul   dword ptr [$0046cdbc]
    fcomp  qword ptr [esp+$10]
    wait
    fstsw  ax
    sahf
    jbe    $0046cda7
    
    Result := True;
    -----------------------------------------------------
    mov    dl,$01
    
    Z[0] := (X[0] < X[1] * 0.5);
    -----------------------------------------------------
    fld    qword ptr [esp+$10]
    fmul   dword ptr [$0046ce78]
    fcomp  qword ptr [esp+$08]
    wait
    fstsw  ax
    sahf
    setnbe al
    mov    [esp],al
    
    Z[1] := (Y[0] < Y[1] * 0.5);
    -----------------------------------------------------
    fld    qword ptr [esp+$20]
    fmul   dword ptr [$0046ce78]
    fcomp  qword ptr [esp+$18]
    wait
    fstsw  ax
    sahf
    setnbe al
    mov    [esp+$01],al
    
    if Z[0] and Z[1] then
    -----------------------------------------------------
    cmp    byte ptr [esp],$00
    jz     $0046ce63
    cmp    byte ptr [esp+$01],$00
    jz     $0046ce63
    
    Result := True;
    -----------------------------------------------------
    mov    dl,$01
    
    if ((arr[12])and(arr[13]))or(arr[128])
    
    TEST arr[12] arr[12]
    SETNZ bytePtr[esp+4] // local variable
    TEST arr[13] arr[13]
    SETNZ bytePtr[esp+5]// local variable
    TEST arr[128] arr[128]
    SETNZ bytePtr[esp+6]// local variable
    
    AND bytePtr[esp+4],bytePtr[esp+5]
    OR bytePtr[esp+4],bytePtr[esp+6]
    
    TEST bytePtr[esp+4],bytePtr[esp+4],
    JNZ // wrong
    
    ...// processing
    
    if height>CriticalHeight then