summarylogtreecommitdiffstats
path: root/fix_dbleps.patch
blob: fe8b3872da828bde6f58fdad5ecccb288de473c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- src/Stage_3_PeakFinderSubFunctions.cpp	2021-10-26 22:22:06.000000000 +0300
+++ src/Stage_3_PeakFinderSubFunctions.cpp	2022-01-24 16:04:10.229537733 +0300
@@ -1141,18 +1141,18 @@
         //----
         if(g!=0){
             //----
             // k_g update:
             //----
-            double Ak_g=1.0/std::max(1.0-B_my_g[g-1]/C_my_g[g-1],std::sqrt(DOUBLE_EPS));
+            double Ak_g=1.0/std::max(1.0-B_my_g[g-1]/C_my_g[g-1],std::sqrt(DBL_EPSILON));
             double Bk_g=A_my_g[g-1]/C_my_g[g-1];
             double Ck_g=RespFiXi_k_g[g-1]/RespFi_k_g[g-1];
-            double k_g=std::max(std::sqrt(DOUBLE_EPS),Ak_g*(Bk_g-Ck_g));
+            double k_g=std::max(std::sqrt(DBL_EPSILON),Ak_g*(Bk_g-Ck_g));
             //----
             // my_g:
             //----
-            my_g[g-1]=Bk_g+std::min(B_my_g[g-1]/C_my_g[g-1],1.0-std::sqrt(DOUBLE_EPS))*k_g;
+            my_g[g-1]=Bk_g+std::min(B_my_g[g-1]/C_my_g[g-1],1.0-std::sqrt(DBL_EPSILON))*k_g;
             // update mx_g:
             mx_g[g-1]=my_g[g-1]-k_g;
             // ----
             // Find constant sums for the other four parameters by updating the weights:
             // ----
@@ -1212,12 +1212,12 @@
             (1.0-6.0*std::pow(lambdax_old,2.0)-lambdax_old);
         double fder4=-6.0*(hypb-1.0)*std::pow(1.0+lambdax_old,2.0)*std::pow(1.0-lambdax_old,2.0)*lambdax_old;
         double fder=fder1-fder2+std::pow(sdx,2.0)*(fder3+fder4)/2.0;
         // update:
         lambdax=lambdax_old-f/fder;
-        if(lambdax>=0.0) lambdax=-std::sqrt(DOUBLE_EPS);
-        if(lambdax<=-1.0) lambdax=-1.0+std::sqrt(DOUBLE_EPS);
+        if(lambdax>=0.0) lambdax=-std::sqrt(DBL_EPSILON);
+        if(lambdax<=-1.0) lambdax=-1.0+std::sqrt(DBL_EPSILON);
         // criterio:
         Ncrit=std::abs(lambdax-lambdax_old);
         // replace lambdax_old:
         lambdax_old=lambdax;
         // iterations:
@@ -1252,12 +1252,12 @@
         double fder4=-(hypb-1.0)*std::pow(1.0+lambday_old,2.0)*(1.0-lambday_old)*
             (1.0-6.0*std::pow(lambday_old,2.0)+lambday_old);
         double fder=fder1-fder2+std::pow(sdy,2.0)*(fder3+fder4)/2.0;
         // update:
         lambday=lambday_old-f/fder;
-        if(lambday>=1.0) lambday=1.0-std::sqrt(DOUBLE_EPS);
-        if(lambday<=0.0) lambday=std::sqrt(DOUBLE_EPS);
+        if(lambday>=1.0) lambday=1.0-std::sqrt(DBL_EPSILON);
+        if(lambday<=0.0) lambday=std::sqrt(DBL_EPSILON);
         // criterio:
         Ncrit=std::abs(lambday-lambday_old);
         // replace lambday_old:
         lambday_old=lambday;
         // iterations: