diff options
Diffstat (limited to 'tests')
993 files changed, 7743 insertions, 0 deletions
diff --git a/tests/01unit_operators/add_cd b/tests/01unit_operators/add_cd new file mode 100644 index 0000000..c5342ce --- /dev/null +++ b/tests/01unit_operators/add_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x,y +R=-6-3i, 6+3i, 0.5+0.25i +F=x+y +C=x+y diff --git a/tests/01unit_operators/add_d b/tests/01unit_operators/add_d new file mode 100644 index 0000000..9d31c21 --- /dev/null +++ b/tests/01unit_operators/add_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-6, 6, 0.5 +F=x+y +C=x+y diff --git a/tests/01unit_operators/add_i b/tests/01unit_operators/add_i new file mode 100644 index 0000000..ce48bcf --- /dev/null +++ b/tests/01unit_operators/add_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-40, 40, 3 +F=x+y +C=x+y diff --git a/tests/01unit_operators/addsub_cd b/tests/01unit_operators/addsub_cd new file mode 100644 index 0000000..bc5a53e --- /dev/null +++ b/tests/01unit_operators/addsub_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x,y,z +R=-6-3i, 6+3i, 0.5+0.25i +F=x+y+x+x-z+x +C=x+y+x+x-z+x diff --git a/tests/01unit_operators/addsub_d b/tests/01unit_operators/addsub_d new file mode 100644 index 0000000..4e856a1 --- /dev/null +++ b/tests/01unit_operators/addsub_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y,z +R=-6, 6, 0.5 +F=x+y+x+x-z+x +C=x+y+x+x-z+x diff --git a/tests/01unit_operators/addsub_i b/tests/01unit_operators/addsub_i new file mode 100644 index 0000000..44db2e9 --- /dev/null +++ b/tests/01unit_operators/addsub_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y,z +R=-40, 40, 3 +F=x+y+x+x-z+x +C=x+y+x+x-z+x diff --git a/tests/01unit_operators/and_d b/tests/01unit_operators/and_d new file mode 100644 index 0000000..5f07962 --- /dev/null +++ b/tests/01unit_operators/and_d @@ -0,0 +1,6 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x&y +C=Value_t( fp_abs(x) >= 0.5 ? fp_abs(y) >= 0.5 : 0 ) + diff --git a/tests/01unit_operators/and_i b/tests/01unit_operators/and_i new file mode 100644 index 0000000..bd8d7c9 --- /dev/null +++ b/tests/01unit_operators/and_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x&y +C=x != 0 ? y != 0 : 0 diff --git a/tests/01unit_operators/cmpeq_cd b/tests/01unit_operators/cmpeq_cd new file mode 100644 index 0000000..946e1cb --- /dev/null +++ b/tests/01unit_operators/cmpeq_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x,y +R=-6-3i, 6+3i, 0.5+0.25i +F=x=y +C=x==y diff --git a/tests/01unit_operators/cmpeq_d b/tests/01unit_operators/cmpeq_d new file mode 100644 index 0000000..e1722ef --- /dev/null +++ b/tests/01unit_operators/cmpeq_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x=y +C=x==y diff --git a/tests/01unit_operators/cmpeq_i b/tests/01unit_operators/cmpeq_i new file mode 100644 index 0000000..ae181a7 --- /dev/null +++ b/tests/01unit_operators/cmpeq_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x=y +C=x==y diff --git a/tests/01unit_operators/cmpge_d b/tests/01unit_operators/cmpge_d new file mode 100644 index 0000000..3d7cf62 --- /dev/null +++ b/tests/01unit_operators/cmpge_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x>=y +C=x>=y diff --git a/tests/01unit_operators/cmpge_i b/tests/01unit_operators/cmpge_i new file mode 100644 index 0000000..d79cb57 --- /dev/null +++ b/tests/01unit_operators/cmpge_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x>=y +C=x>=y diff --git a/tests/01unit_operators/cmpgt_d b/tests/01unit_operators/cmpgt_d new file mode 100644 index 0000000..5ce4a00 --- /dev/null +++ b/tests/01unit_operators/cmpgt_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x>y +C=x>y diff --git a/tests/01unit_operators/cmpgt_i b/tests/01unit_operators/cmpgt_i new file mode 100644 index 0000000..0b57ade --- /dev/null +++ b/tests/01unit_operators/cmpgt_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x>y +C=x>y diff --git a/tests/01unit_operators/cmple_d b/tests/01unit_operators/cmple_d new file mode 100644 index 0000000..5f346c4 --- /dev/null +++ b/tests/01unit_operators/cmple_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x<=y +C=x<=y diff --git a/tests/01unit_operators/cmple_i b/tests/01unit_operators/cmple_i new file mode 100644 index 0000000..7d3070a --- /dev/null +++ b/tests/01unit_operators/cmple_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x<=y +C=x<=y diff --git a/tests/01unit_operators/cmplt_d b/tests/01unit_operators/cmplt_d new file mode 100644 index 0000000..64a08ee --- /dev/null +++ b/tests/01unit_operators/cmplt_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x<y +C=x<y diff --git a/tests/01unit_operators/cmplt_i b/tests/01unit_operators/cmplt_i new file mode 100644 index 0000000..e57d186 --- /dev/null +++ b/tests/01unit_operators/cmplt_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x<y +C=x<y diff --git a/tests/01unit_operators/cmpne_cd b/tests/01unit_operators/cmpne_cd new file mode 100644 index 0000000..5c7a6ed --- /dev/null +++ b/tests/01unit_operators/cmpne_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x,y +R=-6-3i, 6+3i, 0.5+0.25i +F=x!=y +C=x!=y diff --git a/tests/01unit_operators/cmpne_d b/tests/01unit_operators/cmpne_d new file mode 100644 index 0000000..1f82c5b --- /dev/null +++ b/tests/01unit_operators/cmpne_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x!=y +C=x!=y diff --git a/tests/01unit_operators/cmpne_i b/tests/01unit_operators/cmpne_i new file mode 100644 index 0000000..ae7c783 --- /dev/null +++ b/tests/01unit_operators/cmpne_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x!=y +C=x!=y diff --git a/tests/01unit_operators/div_d b/tests/01unit_operators/div_d new file mode 100644 index 0000000..b227862 --- /dev/null +++ b/tests/01unit_operators/div_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-7.25, 7.25, 0.5 +F=(x-0.25)/y +C=(x-0.25)/y diff --git a/tests/01unit_operators/div_i b/tests/01unit_operators/div_i new file mode 100644 index 0000000..8684f03 --- /dev/null +++ b/tests/01unit_operators/div_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-460, 100, 8 +F=x/(y+3) +C=x/(y+3) diff --git a/tests/01unit_operators/divmul_d b/tests/01unit_operators/divmul_d new file mode 100644 index 0000000..b04fc46 --- /dev/null +++ b/tests/01unit_operators/divmul_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y,z +R=-7.25, 7.25, 0.5 +F=x*y*x*x/z*(x-0.25) +C=x*y*x*x/z*(x-0.25) diff --git a/tests/01unit_operators/divmul_i b/tests/01unit_operators/divmul_i new file mode 100644 index 0000000..fd6c686 --- /dev/null +++ b/tests/01unit_operators/divmul_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y,z +R=-46, 40, 2 +F=x*y*x*x/(z+3)*(x+4) +C=x*y*x*x/(z+3)*(x+4) diff --git a/tests/01unit_operators/inv_d b/tests/01unit_operators/inv_d new file mode 100644 index 0000000..f5bb031 --- /dev/null +++ b/tests/01unit_operators/inv_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=-7, 6, 0.6 +F=1/x +C=1/x diff --git a/tests/01unit_operators/inv_i b/tests/01unit_operators/inv_i new file mode 100644 index 0000000..8fbd87a --- /dev/null +++ b/tests/01unit_operators/inv_i @@ -0,0 +1,5 @@ +T=li gi +V=x +R=-41, 40, 3 +F=1/x +C=1/x diff --git a/tests/01unit_operators/mod b/tests/01unit_operators/mod new file mode 100644 index 0000000..6da51d4 --- /dev/null +++ b/tests/01unit_operators/mod @@ -0,0 +1,5 @@ +T=d +V=x,z +R=-11, 11, 0.3 +F=x%z +C=fmod(x,z) diff --git a/tests/01unit_operators/mod_i b/tests/01unit_operators/mod_i new file mode 100644 index 0000000..2ee0e66 --- /dev/null +++ b/tests/01unit_operators/mod_i @@ -0,0 +1,5 @@ +T=li gi +V=x,z +R=-460, 100, 8 +F=x%(z+3) +C=x%(z+3) diff --git a/tests/01unit_operators/modf b/tests/01unit_operators/modf new file mode 100644 index 0000000..9055088 --- /dev/null +++ b/tests/01unit_operators/modf @@ -0,0 +1,5 @@ +T=f +V=x,z +R=-11, 11, 0.3 +F=x%z +C=fmodf(x,z) diff --git a/tests/01unit_operators/modl b/tests/01unit_operators/modl new file mode 100644 index 0000000..ba12da3 --- /dev/null +++ b/tests/01unit_operators/modl @@ -0,0 +1,5 @@ +T=ld +V=x,z +R=-11, 11, 0.3 +F=x%z +C=fmodl(x,z) diff --git a/tests/01unit_operators/modm b/tests/01unit_operators/modm new file mode 100644 index 0000000..c1d553f --- /dev/null +++ b/tests/01unit_operators/modm @@ -0,0 +1,5 @@ +T=mf +V=x,z +R=-11, 11, 0.3 +F=x%z +C=x%z diff --git a/tests/01unit_operators/mul_cd b/tests/01unit_operators/mul_cd new file mode 100644 index 0000000..efe8f72 --- /dev/null +++ b/tests/01unit_operators/mul_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x,y +R=-7.25+3.625i, 7.25-3.625i, 0.5-0.25i +F=x*y +C=x*y diff --git a/tests/01unit_operators/mul_d b/tests/01unit_operators/mul_d new file mode 100644 index 0000000..70a2544 --- /dev/null +++ b/tests/01unit_operators/mul_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-7.25, 7.25, 0.5 +F=x*y +C=x*y diff --git a/tests/01unit_operators/mul_i b/tests/01unit_operators/mul_i new file mode 100644 index 0000000..895699b --- /dev/null +++ b/tests/01unit_operators/mul_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-460, 100, 8 +F=x*(y+4) +C=x*(y+4) diff --git a/tests/01unit_operators/neg_cd b/tests/01unit_operators/neg_cd new file mode 100644 index 0000000..cc25876 --- /dev/null +++ b/tests/01unit_operators/neg_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x +R=-6-3i, 6+3i, 0.5+0.25i +F=-x +C=-x diff --git a/tests/01unit_operators/neg_d b/tests/01unit_operators/neg_d new file mode 100644 index 0000000..dc8ceb4 --- /dev/null +++ b/tests/01unit_operators/neg_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=-6, 6, 0.5 +F=-x +C=-x diff --git a/tests/01unit_operators/neg_i b/tests/01unit_operators/neg_i new file mode 100644 index 0000000..767059b --- /dev/null +++ b/tests/01unit_operators/neg_i @@ -0,0 +1,5 @@ +T=li gi +V=x +R=-40, 40, 3 +F=-x +C=-x diff --git a/tests/01unit_operators/not_d b/tests/01unit_operators/not_d new file mode 100644 index 0000000..cd79c7a --- /dev/null +++ b/tests/01unit_operators/not_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=-1.25,1.25,0.25 +F=!x +C=Value_t( fp_abs(x) < 0.5 ) diff --git a/tests/01unit_operators/not_i b/tests/01unit_operators/not_i new file mode 100644 index 0000000..a600fa1 --- /dev/null +++ b/tests/01unit_operators/not_i @@ -0,0 +1,5 @@ +T=li gi +V=x +R=-2, 2, 1 +F=!x +C=Value_t(x==0) diff --git a/tests/01unit_operators/notnot_d b/tests/01unit_operators/notnot_d new file mode 100644 index 0000000..9ad785a --- /dev/null +++ b/tests/01unit_operators/notnot_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=-1.25,1.25,0.25 +F=!!x +C=Value_t( fp_abs(x) >= 0.5 ) diff --git a/tests/01unit_operators/notnot_i b/tests/01unit_operators/notnot_i new file mode 100644 index 0000000..c676920 --- /dev/null +++ b/tests/01unit_operators/notnot_i @@ -0,0 +1,5 @@ +T=li gi +V=x +R=-2, 2, 1 +F=!!x +C=Value_t(x!=0) diff --git a/tests/01unit_operators/or_d b/tests/01unit_operators/or_d new file mode 100644 index 0000000..810af55 --- /dev/null +++ b/tests/01unit_operators/or_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-1.75, 1.75, 0.25 +F=x|y +C=Value_t( fp_abs(x) < 0.5 ? fp_abs(y) >= 0.5 : 1 ) diff --git a/tests/01unit_operators/or_i b/tests/01unit_operators/or_i new file mode 100644 index 0000000..70e75e6 --- /dev/null +++ b/tests/01unit_operators/or_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2, 2, 1 +F=x|y +C=x == 0 ? y != 0 : 1 diff --git a/tests/01unit_operators/sub_cd b/tests/01unit_operators/sub_cd new file mode 100644 index 0000000..0c962a6 --- /dev/null +++ b/tests/01unit_operators/sub_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x,y +R=-6-3i, 6+3i, 0.5+0.25i +F=x-y +C=x-y diff --git a/tests/01unit_operators/sub_d b/tests/01unit_operators/sub_d new file mode 100644 index 0000000..5ad65f7 --- /dev/null +++ b/tests/01unit_operators/sub_d @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-6, 6, 0.5 +F=x-y +C=x-y diff --git a/tests/01unit_operators/sub_i b/tests/01unit_operators/sub_i new file mode 100644 index 0000000..139c24f --- /dev/null +++ b/tests/01unit_operators/sub_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-40, 40, 3 +F=x-y +C=x-y diff --git a/tests/02unit_functions/abs_cd b/tests/02unit_functions/abs_cd new file mode 100644 index 0000000..a705302 --- /dev/null +++ b/tests/02unit_functions/abs_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x +R=-400+200i, 400-200i, 0.5-0.25i +F=abs(x) +C=std::abs(x) diff --git a/tests/02unit_functions/abs_d b/tests/02unit_functions/abs_d new file mode 100644 index 0000000..7f653d2 --- /dev/null +++ b/tests/02unit_functions/abs_d @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-400, 400, 0.5 +F=abs(x) +C=x<0 ? -x : x diff --git a/tests/02unit_functions/abs_i b/tests/02unit_functions/abs_i new file mode 100644 index 0000000..7100bec --- /dev/null +++ b/tests/02unit_functions/abs_i @@ -0,0 +1,5 @@ +T=li gi +V=x +R=-40000,40000,1 +F=abs(x) +C=x<0 ? -x : x diff --git a/tests/02unit_functions/acos b/tests/02unit_functions/acos new file mode 100644 index 0000000..5d1f912 --- /dev/null +++ b/tests/02unit_functions/acos @@ -0,0 +1,5 @@ +T=d +V=x +R=-1, 1, 0.01 +F=acos(x) +C=acos(x) diff --git a/tests/02unit_functions/acos_deg b/tests/02unit_functions/acos_deg new file mode 100644 index 0000000..dd38ae4 --- /dev/null +++ b/tests/02unit_functions/acos_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-1, 1, 0.01 +F=acos(x) +C=r2d(acos(x)) diff --git a/tests/02unit_functions/acosf b/tests/02unit_functions/acosf new file mode 100644 index 0000000..0693cde --- /dev/null +++ b/tests/02unit_functions/acosf @@ -0,0 +1,5 @@ +T=f +V=x +R=-1, 1, 0.01 +F=acos(x) +C=acosf(x) diff --git a/tests/02unit_functions/acosf_deg b/tests/02unit_functions/acosf_deg new file mode 100644 index 0000000..e222c95 --- /dev/null +++ b/tests/02unit_functions/acosf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-1, 1, 0.01 +F=acos(x) +C=r2d(acosf(x)) diff --git a/tests/02unit_functions/acosh b/tests/02unit_functions/acosh new file mode 100644 index 0000000..57c84ae --- /dev/null +++ b/tests/02unit_functions/acosh @@ -0,0 +1,5 @@ +T=d +V=x +R=1, 400, 0.1 +F=acosh(x) +C=log(x + sqrt(x*x - 1)) diff --git a/tests/02unit_functions/acosh_deg b/tests/02unit_functions/acosh_deg new file mode 100644 index 0000000..312417d --- /dev/null +++ b/tests/02unit_functions/acosh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=1, 400, 0.1 +F=acosh(x) +C=r2d(log(x + sqrt(x*x - 1))) diff --git a/tests/02unit_functions/acoshf b/tests/02unit_functions/acoshf new file mode 100644 index 0000000..889be64 --- /dev/null +++ b/tests/02unit_functions/acoshf @@ -0,0 +1,5 @@ +T=f +V=x +R=1, 400, 0.1 +F=acosh(x) +C=logf(x + sqrtf(x*x - 1)) diff --git a/tests/02unit_functions/acoshf_deg b/tests/02unit_functions/acoshf_deg new file mode 100644 index 0000000..b5003bc --- /dev/null +++ b/tests/02unit_functions/acoshf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=1, 400, 0.1 +F=acosh(x) +C=r2d(fp_acosh(x)) diff --git a/tests/02unit_functions/acoshl b/tests/02unit_functions/acoshl new file mode 100644 index 0000000..bbcc872 --- /dev/null +++ b/tests/02unit_functions/acoshl @@ -0,0 +1,5 @@ +T=ld +V=x +R=1, 400, 0.1 +F=acosh(x) +C=logl(x + sqrtl(x*x - 1)) diff --git a/tests/02unit_functions/acoshl_deg b/tests/02unit_functions/acoshl_deg new file mode 100644 index 0000000..d212abb --- /dev/null +++ b/tests/02unit_functions/acoshl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=1, 400, 0.1 +F=acosh(x) +C=r2d(fp_acosh(x)) diff --git a/tests/02unit_functions/acoshm b/tests/02unit_functions/acoshm new file mode 100644 index 0000000..3165083 --- /dev/null +++ b/tests/02unit_functions/acoshm @@ -0,0 +1,5 @@ +T=mf +V=x +R=1, 400, 0.1 +F=acosh(x) +C=MpfrFloat::acosh(x) diff --git a/tests/02unit_functions/acoshm_deg b/tests/02unit_functions/acoshm_deg new file mode 100644 index 0000000..ba99452 --- /dev/null +++ b/tests/02unit_functions/acoshm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=1, 400, 0.1 +F=acosh(x) +C=r2d(MpfrFloat::acosh(x)) diff --git a/tests/02unit_functions/acosl b/tests/02unit_functions/acosl new file mode 100644 index 0000000..a604ad7 --- /dev/null +++ b/tests/02unit_functions/acosl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-1, 1, 0.01 +F=acos(x) +C=acosl(x) diff --git a/tests/02unit_functions/acosl_deg b/tests/02unit_functions/acosl_deg new file mode 100644 index 0000000..1913d2a --- /dev/null +++ b/tests/02unit_functions/acosl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-1, 1, 0.01 +F=acos(x) +C=r2d(acosl(x)) diff --git a/tests/02unit_functions/acosm b/tests/02unit_functions/acosm new file mode 100644 index 0000000..0119115 --- /dev/null +++ b/tests/02unit_functions/acosm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-1, 1, 0.01 +F=acos(x) +C=MpfrFloat::acos(x) diff --git a/tests/02unit_functions/acosm_deg b/tests/02unit_functions/acosm_deg new file mode 100644 index 0000000..859794c --- /dev/null +++ b/tests/02unit_functions/acosm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-1, 1, 0.01 +F=acos(x) +C=r2d(MpfrFloat::acos(x)) diff --git a/tests/02unit_functions/arg b/tests/02unit_functions/arg new file mode 100644 index 0000000..acfdce2 --- /dev/null +++ b/tests/02unit_functions/arg @@ -0,0 +1,5 @@ +T=cd cf cld +V=x +R=1e-6, 4000, 0.1 +F=log(x) +C=fp_log(x) diff --git a/tests/02unit_functions/asin b/tests/02unit_functions/asin new file mode 100644 index 0000000..e5b729b --- /dev/null +++ b/tests/02unit_functions/asin @@ -0,0 +1,5 @@ +T=d +V=x +R=-1, 1, 0.01 +F=asin(x) +C=asin(x) diff --git a/tests/02unit_functions/asin_deg b/tests/02unit_functions/asin_deg new file mode 100644 index 0000000..f07b959 --- /dev/null +++ b/tests/02unit_functions/asin_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-1, 1, 0.01 +F=asin(x) +C=r2d(asin(x)) diff --git a/tests/02unit_functions/asinf b/tests/02unit_functions/asinf new file mode 100644 index 0000000..7225246 --- /dev/null +++ b/tests/02unit_functions/asinf @@ -0,0 +1,5 @@ +T=f +V=x +R=-1, 1, 0.01 +F=asin(x) +C=asinf(x) diff --git a/tests/02unit_functions/asinf_deg b/tests/02unit_functions/asinf_deg new file mode 100644 index 0000000..2e92b2b --- /dev/null +++ b/tests/02unit_functions/asinf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-1, 1, 0.01 +F=asin(x) +C=r2d(asinf(x)) diff --git a/tests/02unit_functions/asinh b/tests/02unit_functions/asinh new file mode 100644 index 0000000..8e8d6e7 --- /dev/null +++ b/tests/02unit_functions/asinh @@ -0,0 +1,5 @@ +T=d +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=log(x + sqrt(x*x+1)) diff --git a/tests/02unit_functions/asinh_deg b/tests/02unit_functions/asinh_deg new file mode 100644 index 0000000..070f196 --- /dev/null +++ b/tests/02unit_functions/asinh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=r2d(log(x + sqrt(x*x+1))) diff --git a/tests/02unit_functions/asinhf b/tests/02unit_functions/asinhf new file mode 100644 index 0000000..2c2d9ad --- /dev/null +++ b/tests/02unit_functions/asinhf @@ -0,0 +1,5 @@ +T=f +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=logf(x + sqrtf(x*x+1)) diff --git a/tests/02unit_functions/asinhf_deg b/tests/02unit_functions/asinhf_deg new file mode 100644 index 0000000..48bb0f9 --- /dev/null +++ b/tests/02unit_functions/asinhf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=r2d(fp_asinh(x)) diff --git a/tests/02unit_functions/asinhl b/tests/02unit_functions/asinhl new file mode 100644 index 0000000..16ff3ee --- /dev/null +++ b/tests/02unit_functions/asinhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=logl(x + sqrtl(x*x+1)) diff --git a/tests/02unit_functions/asinhl_deg b/tests/02unit_functions/asinhl_deg new file mode 100644 index 0000000..cb85f2a --- /dev/null +++ b/tests/02unit_functions/asinhl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=r2d(fp_asinh(x)) diff --git a/tests/02unit_functions/asinhm b/tests/02unit_functions/asinhm new file mode 100644 index 0000000..687dbe8 --- /dev/null +++ b/tests/02unit_functions/asinhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=MpfrFloat::asinh(x) diff --git a/tests/02unit_functions/asinhm_deg b/tests/02unit_functions/asinhm_deg new file mode 100644 index 0000000..751258b --- /dev/null +++ b/tests/02unit_functions/asinhm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-1, 1, 0.01 +F=asinh(x) +C=r2d(MpfrFloat::asinh(x)) diff --git a/tests/02unit_functions/asinl b/tests/02unit_functions/asinl new file mode 100644 index 0000000..afa8830 --- /dev/null +++ b/tests/02unit_functions/asinl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-1, 1, 0.01 +F=asin(x) +C=asinl(x) diff --git a/tests/02unit_functions/asinl_deg b/tests/02unit_functions/asinl_deg new file mode 100644 index 0000000..41ef020 --- /dev/null +++ b/tests/02unit_functions/asinl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-1, 1, 0.01 +F=asin(x) +C=r2d(asinl(x)) diff --git a/tests/02unit_functions/asinm b/tests/02unit_functions/asinm new file mode 100644 index 0000000..eaa7f21 --- /dev/null +++ b/tests/02unit_functions/asinm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-1, 1, 0.01 +F=asin(x) +C=MpfrFloat::asin(x) diff --git a/tests/02unit_functions/asinm_deg b/tests/02unit_functions/asinm_deg new file mode 100644 index 0000000..31c1ba9 --- /dev/null +++ b/tests/02unit_functions/asinm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-1, 1, 0.01 +F=asin(x) +C=r2d(MpfrFloat::asin(x)) diff --git a/tests/02unit_functions/atan b/tests/02unit_functions/atan new file mode 100644 index 0000000..c83857e --- /dev/null +++ b/tests/02unit_functions/atan @@ -0,0 +1,5 @@ +T=d +V=x +R=-400, 400, 0.1 +F=atan(x) +C=atan(x) diff --git a/tests/02unit_functions/atan2 b/tests/02unit_functions/atan2 new file mode 100644 index 0000000..6918cdf --- /dev/null +++ b/tests/02unit_functions/atan2 @@ -0,0 +1,5 @@ +T=d +V=x,y +R=-4, 4, 0.05 +F=atan2(x,y) +C=atan2(x,y) diff --git a/tests/02unit_functions/atan2_deg b/tests/02unit_functions/atan2_deg new file mode 100644 index 0000000..b5e5596 --- /dev/null +++ b/tests/02unit_functions/atan2_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x,y +R=-4, 4, 0.05 +F=atan2(x,y) +C=r2d(atan2(x,y)) diff --git a/tests/02unit_functions/atan2f b/tests/02unit_functions/atan2f new file mode 100644 index 0000000..b702b24 --- /dev/null +++ b/tests/02unit_functions/atan2f @@ -0,0 +1,5 @@ +T=f +V=x,y +R=-4, 4, 0.05 +F=atan2(x,y) +C=atan2f(x,y) diff --git a/tests/02unit_functions/atan2f_deg b/tests/02unit_functions/atan2f_deg new file mode 100644 index 0000000..f644ec1 --- /dev/null +++ b/tests/02unit_functions/atan2f_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x,y +R=-4, 4, 0.05 +F=atan2(x,y) +C=r2d(atan2f(x,y)) diff --git a/tests/02unit_functions/atan2l b/tests/02unit_functions/atan2l new file mode 100644 index 0000000..0c8c5d4 --- /dev/null +++ b/tests/02unit_functions/atan2l @@ -0,0 +1,5 @@ +T=ld +V=x,y +R=-4, 4, 0.05 +F=atan2(x,y) +C=atan2l(x,y) diff --git a/tests/02unit_functions/atan2l_deg b/tests/02unit_functions/atan2l_deg new file mode 100644 index 0000000..40959dd --- /dev/null +++ b/tests/02unit_functions/atan2l_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x,y +R=-4, 4, 0.05 +F=atan2(x,y) +C=r2d(atan2l(x,y)) diff --git a/tests/02unit_functions/atan2m b/tests/02unit_functions/atan2m new file mode 100644 index 0000000..0b0e43f --- /dev/null +++ b/tests/02unit_functions/atan2m @@ -0,0 +1,5 @@ +T=mf +V=x,y +R=-4, 4, 0.15 +F=atan2(x,y) +C=MpfrFloat::atan2(x,y) diff --git a/tests/02unit_functions/atan2m_deg b/tests/02unit_functions/atan2m_deg new file mode 100644 index 0000000..693c47f --- /dev/null +++ b/tests/02unit_functions/atan2m_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x,y +R=-4, 4, 0.15 +F=atan2(x,y) +C=r2d(MpfrFloat::atan2(x,y)) diff --git a/tests/02unit_functions/atan_deg b/tests/02unit_functions/atan_deg new file mode 100644 index 0000000..231132a --- /dev/null +++ b/tests/02unit_functions/atan_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-400, 400, 0.1 +F=atan(x) +C=r2d(atan(x)) diff --git a/tests/02unit_functions/atanf b/tests/02unit_functions/atanf new file mode 100644 index 0000000..0e32636 --- /dev/null +++ b/tests/02unit_functions/atanf @@ -0,0 +1,5 @@ +T=f +V=x +R=-400, 400, 0.1 +F=atan(x) +C=atanf(x) diff --git a/tests/02unit_functions/atanf_deg b/tests/02unit_functions/atanf_deg new file mode 100644 index 0000000..0dd400e --- /dev/null +++ b/tests/02unit_functions/atanf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-400, 400, 0.1 +F=atan(x) +C=r2d(atanf(x)) diff --git a/tests/02unit_functions/atanh b/tests/02unit_functions/atanh new file mode 100644 index 0000000..f384ac0 --- /dev/null +++ b/tests/02unit_functions/atanh @@ -0,0 +1,5 @@ +T=d +V=x +R=-1, 1, 0.01 +F=atanh(x) +C=log( (1+x) / (1-x) ) * 0.5 diff --git a/tests/02unit_functions/atanhf b/tests/02unit_functions/atanhf new file mode 100644 index 0000000..9dec86e --- /dev/null +++ b/tests/02unit_functions/atanhf @@ -0,0 +1,5 @@ +T=f +V=x +R=-1, 1, 0.01 +F=atanh(x) +C=logf( (1+x) / (1-x) ) * 0.5 diff --git a/tests/02unit_functions/atanhl b/tests/02unit_functions/atanhl new file mode 100644 index 0000000..ed6f206 --- /dev/null +++ b/tests/02unit_functions/atanhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-1, 1, 0.01 +F=atanh(x) +C=logl( (1+x) / (1-x) ) * 0.5 diff --git a/tests/02unit_functions/atanhm b/tests/02unit_functions/atanhm new file mode 100644 index 0000000..d895a60 --- /dev/null +++ b/tests/02unit_functions/atanhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-1, 1, 0.01 +F=atanh(x) +C=MpfrFloat::atanh(x) diff --git a/tests/02unit_functions/atanl b/tests/02unit_functions/atanl new file mode 100644 index 0000000..1866866 --- /dev/null +++ b/tests/02unit_functions/atanl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-400, 400, 0.1 +F=atan(x) +C=atanl(x) diff --git a/tests/02unit_functions/atanl_deg b/tests/02unit_functions/atanl_deg new file mode 100644 index 0000000..f1a541e --- /dev/null +++ b/tests/02unit_functions/atanl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-400, 400, 0.1 +F=atan(x) +C=r2d(atanl(x)) diff --git a/tests/02unit_functions/atanm b/tests/02unit_functions/atanm new file mode 100644 index 0000000..721981a --- /dev/null +++ b/tests/02unit_functions/atanm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-400, 400, 0.1 +F=atan(x) +C=MpfrFloat::atan(x) diff --git a/tests/02unit_functions/atanm_deg b/tests/02unit_functions/atanm_deg new file mode 100644 index 0000000..54a5b6f --- /dev/null +++ b/tests/02unit_functions/atanm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-400, 400, 0.1 +F=atan(x) +C=r2d(MpfrFloat::atan(x)) diff --git a/tests/02unit_functions/cbrt b/tests/02unit_functions/cbrt new file mode 100644 index 0000000..1d498c8 --- /dev/null +++ b/tests/02unit_functions/cbrt @@ -0,0 +1,5 @@ +T=d +V=x +R=-50000, 50000, 1000 +F=cbrt(x) +C=x<0 ? -exp(log(-x) / 3) : (x>0 ? exp(log(x) / 3) : 0) diff --git a/tests/02unit_functions/cbrtf b/tests/02unit_functions/cbrtf new file mode 100644 index 0000000..d1528d3 --- /dev/null +++ b/tests/02unit_functions/cbrtf @@ -0,0 +1,5 @@ +T=f +V=x +R=-50000, 50000, 1000 +F=cbrt(x) +C=fp_cbrt(x) diff --git a/tests/02unit_functions/cbrtl b/tests/02unit_functions/cbrtl new file mode 100644 index 0000000..f866be4 --- /dev/null +++ b/tests/02unit_functions/cbrtl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-50000, 50000, 1000 +F=cbrt(x) +C=fp_cbrt(x) diff --git a/tests/02unit_functions/cbrtm b/tests/02unit_functions/cbrtm new file mode 100644 index 0000000..6c7a52a --- /dev/null +++ b/tests/02unit_functions/cbrtm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-50000, 50000, 1000 +F=cbrt(x) +C=MpfrFloat::cbrt(x) diff --git a/tests/02unit_functions/ceil b/tests/02unit_functions/ceil new file mode 100644 index 0000000..8b61894 --- /dev/null +++ b/tests/02unit_functions/ceil @@ -0,0 +1,5 @@ +T=d +V=x +R=-10, 10, 0.25 +F=ceil(x) +C=ceil(x) diff --git a/tests/02unit_functions/ceilf b/tests/02unit_functions/ceilf new file mode 100644 index 0000000..90c4ef9 --- /dev/null +++ b/tests/02unit_functions/ceilf @@ -0,0 +1,5 @@ +T=f +V=x +R=-10, 10, 0.25 +F=ceil(x) +C=ceilf(x) diff --git a/tests/02unit_functions/ceill b/tests/02unit_functions/ceill new file mode 100644 index 0000000..e6843da --- /dev/null +++ b/tests/02unit_functions/ceill @@ -0,0 +1,5 @@ +T=ld +V=x +R=-10, 10, 0.25 +F=ceil(x) +C=ceill(x) diff --git a/tests/02unit_functions/ceilm b/tests/02unit_functions/ceilm new file mode 100644 index 0000000..8fe2570 --- /dev/null +++ b/tests/02unit_functions/ceilm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-10, 10, 0.25 +F=ceil(x) +C=MpfrFloat::ceil(x) diff --git a/tests/02unit_functions/conj b/tests/02unit_functions/conj new file mode 100644 index 0000000..8cd6dd0 --- /dev/null +++ b/tests/02unit_functions/conj @@ -0,0 +1,5 @@ +T=cd cf cld +V=x +R=1e-6, 4000, 0.1 +F=conj(x) +C=fp_conj(x) diff --git a/tests/02unit_functions/cos b/tests/02unit_functions/cos new file mode 100644 index 0000000..c19805b --- /dev/null +++ b/tests/02unit_functions/cos @@ -0,0 +1,5 @@ +T=d +V=x +R=-40000, 40000, 5 +F=cos(x) +C=cos(x) diff --git a/tests/02unit_functions/cos_cd b/tests/02unit_functions/cos_cd new file mode 100644 index 0000000..14999d2 --- /dev/null +++ b/tests/02unit_functions/cos_cd @@ -0,0 +1,5 @@ +T=cd +V=x +R=-40000+200i, 40000-200i, 5-0.025i +F=cos(x) +C=cos(x) diff --git a/tests/02unit_functions/cos_cf b/tests/02unit_functions/cos_cf new file mode 100644 index 0000000..26f8251 --- /dev/null +++ b/tests/02unit_functions/cos_cf @@ -0,0 +1,5 @@ +T=cf +V=x +R=-40+0.5i, 40-0.5i, 0.1-0.00125i +F=cos(x) +C=cos(x) diff --git a/tests/02unit_functions/cos_deg b/tests/02unit_functions/cos_deg new file mode 100644 index 0000000..cb5fe5d --- /dev/null +++ b/tests/02unit_functions/cos_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-40000, 40000, 5 +F=cos(x) +C=cos(d2r(x)) diff --git a/tests/02unit_functions/cosf b/tests/02unit_functions/cosf new file mode 100644 index 0000000..6aa61fb --- /dev/null +++ b/tests/02unit_functions/cosf @@ -0,0 +1,5 @@ +T=f +V=x +R=-40000, 40000, 5 +F=cos(x) +C=cosf(x) diff --git a/tests/02unit_functions/cosf_deg b/tests/02unit_functions/cosf_deg new file mode 100644 index 0000000..d6cf602 --- /dev/null +++ b/tests/02unit_functions/cosf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-400, 400, 5 +F=cos(x) +C=cosf(d2r(x)) diff --git a/tests/02unit_functions/cosh b/tests/02unit_functions/cosh new file mode 100644 index 0000000..c6e2d38 --- /dev/null +++ b/tests/02unit_functions/cosh @@ -0,0 +1,5 @@ +T=d +V=x +R=-140, 140, 0.1 +F=cosh(x) +C=cosh(x) diff --git a/tests/02unit_functions/cosh_deg b/tests/02unit_functions/cosh_deg new file mode 100644 index 0000000..661f901 --- /dev/null +++ b/tests/02unit_functions/cosh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-140, 140, 0.1 +F=cosh(x) +C=cosh(d2r(x)) diff --git a/tests/02unit_functions/coshf b/tests/02unit_functions/coshf new file mode 100644 index 0000000..7cfa833 --- /dev/null +++ b/tests/02unit_functions/coshf @@ -0,0 +1,5 @@ +T=f +V=x +R=-40, 40, 0.025 +F=cosh(x) +C=coshf(x) diff --git a/tests/02unit_functions/coshf_deg b/tests/02unit_functions/coshf_deg new file mode 100644 index 0000000..1d80afd --- /dev/null +++ b/tests/02unit_functions/coshf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-40, 40, 0.1 +F=cosh(x) +C=coshf(d2r(x)) diff --git a/tests/02unit_functions/coshl b/tests/02unit_functions/coshl new file mode 100644 index 0000000..82b1e8f --- /dev/null +++ b/tests/02unit_functions/coshl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-140, 140, 0.1 +F=cosh(x) +C=coshl(x) diff --git a/tests/02unit_functions/coshl_deg b/tests/02unit_functions/coshl_deg new file mode 100644 index 0000000..9a73466 --- /dev/null +++ b/tests/02unit_functions/coshl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-140, 140, 0.1 +F=cosh(x) +C=coshl(d2r(x)) diff --git a/tests/02unit_functions/coshm b/tests/02unit_functions/coshm new file mode 100644 index 0000000..99cd539 --- /dev/null +++ b/tests/02unit_functions/coshm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-140, 140, 0.1 +F=cosh(x) +C=MpfrFloat::cosh(x) diff --git a/tests/02unit_functions/coshm_deg b/tests/02unit_functions/coshm_deg new file mode 100644 index 0000000..104ad77 --- /dev/null +++ b/tests/02unit_functions/coshm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-140, 140, 0.1 +F=cosh(x) +C=MpfrFloat::cosh(d2r(x)) diff --git a/tests/02unit_functions/cosl b/tests/02unit_functions/cosl new file mode 100644 index 0000000..d1854dc --- /dev/null +++ b/tests/02unit_functions/cosl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-40000, 40000, 5 +F=cos(x) +C=cosl(x) diff --git a/tests/02unit_functions/cosl_deg b/tests/02unit_functions/cosl_deg new file mode 100644 index 0000000..92e70bd --- /dev/null +++ b/tests/02unit_functions/cosl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-40000, 40000, 5 +F=cos(x) +C=cosl(d2r(x)) diff --git a/tests/02unit_functions/cosm b/tests/02unit_functions/cosm new file mode 100644 index 0000000..1f0dae2 --- /dev/null +++ b/tests/02unit_functions/cosm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-40000, 40000, 5 +F=cos(x) +C=MpfrFloat::cos(x) diff --git a/tests/02unit_functions/cosm_deg b/tests/02unit_functions/cosm_deg new file mode 100644 index 0000000..bae1a86 --- /dev/null +++ b/tests/02unit_functions/cosm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-40000, 40000, 5 +F=cos(x) +C=MpfrFloat::cos(d2r(x)) diff --git a/tests/02unit_functions/exp b/tests/02unit_functions/exp new file mode 100644 index 0000000..d05c279 --- /dev/null +++ b/tests/02unit_functions/exp @@ -0,0 +1,5 @@ +T=d +V=x +R=-90, 90, 0.01 +F=exp(x) +C=exp(x) diff --git a/tests/02unit_functions/exp2 b/tests/02unit_functions/exp2 new file mode 100644 index 0000000..8649683 --- /dev/null +++ b/tests/02unit_functions/exp2 @@ -0,0 +1,5 @@ +T=d +V=x +R=-90, 90, 0.01 +F=exp2(x) +C=exp(x*fp_const_log2<Value_t>()) diff --git a/tests/02unit_functions/exp2f b/tests/02unit_functions/exp2f new file mode 100644 index 0000000..ad7a0b0 --- /dev/null +++ b/tests/02unit_functions/exp2f @@ -0,0 +1,5 @@ +T=f +V=x +R=-90, 90, 0.01 +F=exp2(x) +C=expf(x*fp_const_log2<Value_t>()) diff --git a/tests/02unit_functions/exp2l b/tests/02unit_functions/exp2l new file mode 100644 index 0000000..d365a8d --- /dev/null +++ b/tests/02unit_functions/exp2l @@ -0,0 +1,5 @@ +T=ld +V=x +R=-90, 90, 0.01 +F=exp2(x) +C=expl(x*fp_const_log2<Value_t>()) diff --git a/tests/02unit_functions/exp2m b/tests/02unit_functions/exp2m new file mode 100644 index 0000000..1c93425 --- /dev/null +++ b/tests/02unit_functions/exp2m @@ -0,0 +1,5 @@ +T=mf +V=x +R=-90, 90, 0.02 +F=exp2(x) +C=MpfrFloat::exp2(x) diff --git a/tests/02unit_functions/expf b/tests/02unit_functions/expf new file mode 100644 index 0000000..5c88609 --- /dev/null +++ b/tests/02unit_functions/expf @@ -0,0 +1,5 @@ +T=f +V=x +R=-20, 20, 0.01 +F=exp(x) +C=expf(x) diff --git a/tests/02unit_functions/expl b/tests/02unit_functions/expl new file mode 100644 index 0000000..7e86303 --- /dev/null +++ b/tests/02unit_functions/expl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-90, 90, 0.01 +F=exp(x) +C=expl(x) diff --git a/tests/02unit_functions/expm b/tests/02unit_functions/expm new file mode 100644 index 0000000..c3f5310 --- /dev/null +++ b/tests/02unit_functions/expm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-90, 90, 0.02 +F=exp(x) +C=MpfrFloat::exp(x) diff --git a/tests/02unit_functions/floor b/tests/02unit_functions/floor new file mode 100644 index 0000000..230d4cf --- /dev/null +++ b/tests/02unit_functions/floor @@ -0,0 +1,5 @@ +T=d +V=x +R=-10, 10, 0.25 +F=floor(x) +C=floor(x) diff --git a/tests/02unit_functions/floorf b/tests/02unit_functions/floorf new file mode 100644 index 0000000..b87db8f --- /dev/null +++ b/tests/02unit_functions/floorf @@ -0,0 +1,5 @@ +T=f +V=x +R=-10, 10, 0.25 +F=floor(x) +C=floorf(x) diff --git a/tests/02unit_functions/floorl b/tests/02unit_functions/floorl new file mode 100644 index 0000000..e31112b --- /dev/null +++ b/tests/02unit_functions/floorl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-10, 10, 0.25 +F=floor(x) +C=floorl(x) diff --git a/tests/02unit_functions/floorm b/tests/02unit_functions/floorm new file mode 100644 index 0000000..cd3648c --- /dev/null +++ b/tests/02unit_functions/floorm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-10, 10, 0.25 +F=floor(x) +C=MpfrFloat::floor(x) diff --git a/tests/02unit_functions/hypot b/tests/02unit_functions/hypot new file mode 100644 index 0000000..a6c0a1b --- /dev/null +++ b/tests/02unit_functions/hypot @@ -0,0 +1,5 @@ +T=d +V=x,y +R=-4, 4, 0.05 +F=hypot(x,y) +C=sqrt(x*x + y*y) diff --git a/tests/02unit_functions/hypotf b/tests/02unit_functions/hypotf new file mode 100644 index 0000000..68862cd --- /dev/null +++ b/tests/02unit_functions/hypotf @@ -0,0 +1,5 @@ +T=f +V=x,y +R=-4, 4, 0.05 +F=hypot(x,y) +C=sqrtf(x*x + y*y) diff --git a/tests/02unit_functions/hypotl b/tests/02unit_functions/hypotl new file mode 100644 index 0000000..6417228 --- /dev/null +++ b/tests/02unit_functions/hypotl @@ -0,0 +1,5 @@ +T=ld +V=x,y +R=-4, 4, 0.05 +F=hypot(x,y) +C=sqrtl(x*x + y*y) diff --git a/tests/02unit_functions/hypotm b/tests/02unit_functions/hypotm new file mode 100644 index 0000000..58bb300 --- /dev/null +++ b/tests/02unit_functions/hypotm @@ -0,0 +1,5 @@ +T=mf +V=x,y +R=-4, 4, 0.05 +F=hypot(x,y) +C=MpfrFloat::hypot(x,y) diff --git a/tests/02unit_functions/if_d b/tests/02unit_functions/if_d new file mode 100644 index 0000000..04d3479 --- /dev/null +++ b/tests/02unit_functions/if_d @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y,z +R=-1.25,1.25,0.25 +F=if(x,y,z) +C=fp_abs(x) >= 0.5 ? y : z diff --git a/tests/02unit_functions/if_i b/tests/02unit_functions/if_i new file mode 100644 index 0000000..5d394ed --- /dev/null +++ b/tests/02unit_functions/if_i @@ -0,0 +1,5 @@ +T=li gi +V=x,y,z +R=-2,2,1 +F=if(x,y,z) +C=(x!=0) ? y : z diff --git a/tests/02unit_functions/imag b/tests/02unit_functions/imag new file mode 100644 index 0000000..6468817 --- /dev/null +++ b/tests/02unit_functions/imag @@ -0,0 +1,5 @@ +T=cd cf cld +V=x +R=1e-6, 4000, 0.1 +F=imag(x) +C=fp_imag(x) diff --git a/tests/02unit_functions/int b/tests/02unit_functions/int new file mode 100644 index 0000000..937f132 --- /dev/null +++ b/tests/02unit_functions/int @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-4000, 4000, 0.1 +F=int(x) +C=fp_floor(x+0.5) diff --git a/tests/02unit_functions/log b/tests/02unit_functions/log new file mode 100644 index 0000000..13fb797 --- /dev/null +++ b/tests/02unit_functions/log @@ -0,0 +1,5 @@ +T=d cd +V=x +R=1e-6, 4000, 0.1 +F=log(x) +C=log(x) diff --git a/tests/02unit_functions/log10 b/tests/02unit_functions/log10 new file mode 100644 index 0000000..fb595b5 --- /dev/null +++ b/tests/02unit_functions/log10 @@ -0,0 +1,5 @@ +T=d +V=x +R=1e-6, 4000, 0.1 +F=log10(x) +C=log(x)*0.43429448190325182765112891891660508229 diff --git a/tests/02unit_functions/log10f b/tests/02unit_functions/log10f new file mode 100644 index 0000000..1448fed --- /dev/null +++ b/tests/02unit_functions/log10f @@ -0,0 +1,5 @@ +T=f +V=x +R=1e-6, 400, 0.1 +F=log10(x) +C=log10f(x) diff --git a/tests/02unit_functions/log10l b/tests/02unit_functions/log10l new file mode 100644 index 0000000..61aafd7 --- /dev/null +++ b/tests/02unit_functions/log10l @@ -0,0 +1,5 @@ +T=ld +V=x +R=1e-6, 400, 0.1 +F=log10(x) +C=log10l(x) diff --git a/tests/02unit_functions/log10m b/tests/02unit_functions/log10m new file mode 100644 index 0000000..453f90a --- /dev/null +++ b/tests/02unit_functions/log10m @@ -0,0 +1,5 @@ +T=mf +V=x +R=1e-6, 400, 0.1 +F=log10(x) +C=MpfrFloat::log10(x) diff --git a/tests/02unit_functions/log2 b/tests/02unit_functions/log2 new file mode 100644 index 0000000..0ce4db6 --- /dev/null +++ b/tests/02unit_functions/log2 @@ -0,0 +1,5 @@ +T=d +V=x +R=1e-6, 4000, 0.1 +F=log2(x) +C=log(x)*1.4426950408889634073599246810018921374266 diff --git a/tests/02unit_functions/log2f b/tests/02unit_functions/log2f new file mode 100644 index 0000000..6835620 --- /dev/null +++ b/tests/02unit_functions/log2f @@ -0,0 +1,5 @@ +T=f +V=x +R=1e-6, 400, 0.1 +F=log2(x) +C=logf(x)*1.4426950408889634073599246810018921374266 diff --git a/tests/02unit_functions/log2l b/tests/02unit_functions/log2l new file mode 100644 index 0000000..420e719 --- /dev/null +++ b/tests/02unit_functions/log2l @@ -0,0 +1,5 @@ +T=ld +V=x +R=1e-6, 400, 0.1 +F=log2(x) +C=logl(x)*1.4426950408889634073599246810018921374266 diff --git a/tests/02unit_functions/log2m b/tests/02unit_functions/log2m new file mode 100644 index 0000000..16f0d8d --- /dev/null +++ b/tests/02unit_functions/log2m @@ -0,0 +1,5 @@ +T=mf +V=x +R=1e-6, 400, 0.1 +F=log2(x) +C=MpfrFloat::log2(x) diff --git a/tests/02unit_functions/log_cd b/tests/02unit_functions/log_cd new file mode 100644 index 0000000..77c63a9 --- /dev/null +++ b/tests/02unit_functions/log_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x +R=-4000-0.5i, 4000+0.5i, 0.3+3.75e-05i +F=log(x) +C=std::log(x) diff --git a/tests/02unit_functions/logf b/tests/02unit_functions/logf new file mode 100644 index 0000000..66171a1 --- /dev/null +++ b/tests/02unit_functions/logf @@ -0,0 +1,5 @@ +T=f +V=x +R=1e-6, 400, 0.1 +F=log(x) +C=logf(x) diff --git a/tests/02unit_functions/logl b/tests/02unit_functions/logl new file mode 100644 index 0000000..7e271b8 --- /dev/null +++ b/tests/02unit_functions/logl @@ -0,0 +1,5 @@ +T=ld +V=x +R=1e-6, 400, 0.1 +F=log(x) +C=logl(x) diff --git a/tests/02unit_functions/logm b/tests/02unit_functions/logm new file mode 100644 index 0000000..31796de --- /dev/null +++ b/tests/02unit_functions/logm @@ -0,0 +1,5 @@ +T=mf +V=x +R=1e-6, 400, 0.1 +F=log(x) +C=MpfrFloat::log(x) diff --git a/tests/02unit_functions/max b/tests/02unit_functions/max new file mode 100644 index 0000000..628f649 --- /dev/null +++ b/tests/02unit_functions/max @@ -0,0 +1,5 @@ +T=d f ld mf li gi cd cf cld +V=x,y +R=-4, 4, 1 +F=max(x,y) +C=x>y ? x : y diff --git a/tests/02unit_functions/min b/tests/02unit_functions/min new file mode 100644 index 0000000..bd1d2a6 --- /dev/null +++ b/tests/02unit_functions/min @@ -0,0 +1,5 @@ +T=d f ld mf li gi cd cf cld +V=x,y +R=-4, 4, 1 +F=min(x,y) +C=x<y ? x : y diff --git a/tests/02unit_functions/polar b/tests/02unit_functions/polar new file mode 100644 index 0000000..75de241 --- /dev/null +++ b/tests/02unit_functions/polar @@ -0,0 +1,5 @@ +T=cd cf cld +V=x,y +R=0.01, 4, 0.05 +F=polar(x,y) +C=fp_polar(x,y) diff --git a/tests/02unit_functions/pow_neg b/tests/02unit_functions/pow_neg new file mode 100644 index 0000000..ce23e35 --- /dev/null +++ b/tests/02unit_functions/pow_neg @@ -0,0 +1,5 @@ +T=d +V=x,y +R=1,20,1 +F=pow(-x*0.25,y) +C=pow(-x*0.25,y) diff --git a/tests/02unit_functions/pow_negf b/tests/02unit_functions/pow_negf new file mode 100644 index 0000000..91b1bcf --- /dev/null +++ b/tests/02unit_functions/pow_negf @@ -0,0 +1,5 @@ +T=f +V=x,y +R=1,20,1 +F=pow(-x*0.25,y) +C=powf(-x*0.25,y) diff --git a/tests/02unit_functions/pow_negl b/tests/02unit_functions/pow_negl new file mode 100644 index 0000000..0c635c5 --- /dev/null +++ b/tests/02unit_functions/pow_negl @@ -0,0 +1,5 @@ +T=ld +V=x,y +R=1,20,1 +F=pow(-x*0.25,y) +C=powl(-x*0.25,y) diff --git a/tests/02unit_functions/pow_negm b/tests/02unit_functions/pow_negm new file mode 100644 index 0000000..47fa878 --- /dev/null +++ b/tests/02unit_functions/pow_negm @@ -0,0 +1,5 @@ +T=mf +V=x,y +R=1,20,1 +F=pow(-x*0.25,y) +C=MpfrFloat::pow(-x*0.25,y) diff --git a/tests/02unit_functions/pow_pos b/tests/02unit_functions/pow_pos new file mode 100644 index 0000000..c7cc75c --- /dev/null +++ b/tests/02unit_functions/pow_pos @@ -0,0 +1,5 @@ +T=d +V=x,y +R=0.01, 4, 0.05 +F=pow(x,y) +C=pow(x,y) diff --git a/tests/02unit_functions/pow_posf b/tests/02unit_functions/pow_posf new file mode 100644 index 0000000..003ae1e --- /dev/null +++ b/tests/02unit_functions/pow_posf @@ -0,0 +1,5 @@ +T=f +V=x,y +R=0.01, 4, 0.05 +F=pow(x,y) +C=powf(x,y) diff --git a/tests/02unit_functions/pow_posl b/tests/02unit_functions/pow_posl new file mode 100644 index 0000000..ecb2c67 --- /dev/null +++ b/tests/02unit_functions/pow_posl @@ -0,0 +1,5 @@ +T=ld +V=x,y +R=0.01, 4, 0.05 +F=pow(x,y) +C=powl(x,y) diff --git a/tests/02unit_functions/pow_posm b/tests/02unit_functions/pow_posm new file mode 100644 index 0000000..779cdb6 --- /dev/null +++ b/tests/02unit_functions/pow_posm @@ -0,0 +1,5 @@ +T=mf +V=x,y +R=0.01, 4, 0.05 +F=pow(x,y) +C=MpfrFloat::pow(x,y) diff --git a/tests/02unit_functions/real b/tests/02unit_functions/real new file mode 100644 index 0000000..9b4de48 --- /dev/null +++ b/tests/02unit_functions/real @@ -0,0 +1,5 @@ +T=cd cf cld +V=x +R=1e-6, 4000, 0.1 +F=real(x) +C=fp_real(x) diff --git a/tests/02unit_functions/sin b/tests/02unit_functions/sin new file mode 100644 index 0000000..15381bb --- /dev/null +++ b/tests/02unit_functions/sin @@ -0,0 +1,5 @@ +T=d +V=x +R=-40000, 40000, 5 +F=sin(x) +C=sin(x) diff --git a/tests/02unit_functions/sin_cd b/tests/02unit_functions/sin_cd new file mode 100644 index 0000000..078286f --- /dev/null +++ b/tests/02unit_functions/sin_cd @@ -0,0 +1,5 @@ +T=cd +V=x +R=-40000+200i, 40000-200i, 5-0.025i +F=sin(x) +C=sin(x) diff --git a/tests/02unit_functions/sin_cf b/tests/02unit_functions/sin_cf new file mode 100644 index 0000000..7a7f405 --- /dev/null +++ b/tests/02unit_functions/sin_cf @@ -0,0 +1,5 @@ +T=cf +V=x +R=-40+0.5i, 40-0.5i, 0.1-0.00125i +F=sin(x) +C=sin(x) diff --git a/tests/02unit_functions/sin_deg b/tests/02unit_functions/sin_deg new file mode 100644 index 0000000..bb4d998 --- /dev/null +++ b/tests/02unit_functions/sin_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-40000, 40000, 5 +F=sin(x) +C=sin(d2r(x)) diff --git a/tests/02unit_functions/sinf b/tests/02unit_functions/sinf new file mode 100644 index 0000000..0561a8d --- /dev/null +++ b/tests/02unit_functions/sinf @@ -0,0 +1,5 @@ +T=f +V=x +R=-40000, 40000, 5 +F=sin(x) +C=sinf(x) diff --git a/tests/02unit_functions/sinf_deg b/tests/02unit_functions/sinf_deg new file mode 100644 index 0000000..39335fb --- /dev/null +++ b/tests/02unit_functions/sinf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-400, 400, 5 +F=sin(x) +C=sinf(d2r(x)) diff --git a/tests/02unit_functions/sinh b/tests/02unit_functions/sinh new file mode 100644 index 0000000..cae9a88 --- /dev/null +++ b/tests/02unit_functions/sinh @@ -0,0 +1,5 @@ +T=d +V=x +R=-400, 400, 0.1 +F=sinh(x) +C=sinh(x) diff --git a/tests/02unit_functions/sinh_deg b/tests/02unit_functions/sinh_deg new file mode 100644 index 0000000..13aef19 --- /dev/null +++ b/tests/02unit_functions/sinh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-400, 400, 0.1 +F=sinh(x) +C=sinh(d2r(x)) diff --git a/tests/02unit_functions/sinhf b/tests/02unit_functions/sinhf new file mode 100644 index 0000000..30e1271 --- /dev/null +++ b/tests/02unit_functions/sinhf @@ -0,0 +1,5 @@ +T=f +V=x +R=-40, 40, 0.1 +F=sinh(x) +C=sinhf(x) diff --git a/tests/02unit_functions/sinhf_deg b/tests/02unit_functions/sinhf_deg new file mode 100644 index 0000000..f6f0583 --- /dev/null +++ b/tests/02unit_functions/sinhf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-400, 400, 0.1 +F=sinh(x) +C=sinhf(d2r(x)) diff --git a/tests/02unit_functions/sinhl b/tests/02unit_functions/sinhl new file mode 100644 index 0000000..335c698 --- /dev/null +++ b/tests/02unit_functions/sinhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-400, 400, 0.1 +F=sinh(x) +C=sinhl(x) diff --git a/tests/02unit_functions/sinhl_deg b/tests/02unit_functions/sinhl_deg new file mode 100644 index 0000000..61ad0d7 --- /dev/null +++ b/tests/02unit_functions/sinhl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-400, 400, 0.1 +F=sinh(x) +C=sinhl(d2r(x)) diff --git a/tests/02unit_functions/sinhm b/tests/02unit_functions/sinhm new file mode 100644 index 0000000..c29f910 --- /dev/null +++ b/tests/02unit_functions/sinhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-400, 400, 0.1 +F=sinh(x) +C=MpfrFloat::sinh(x) diff --git a/tests/02unit_functions/sinhm_deg b/tests/02unit_functions/sinhm_deg new file mode 100644 index 0000000..fc5e1d6 --- /dev/null +++ b/tests/02unit_functions/sinhm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-400, 400, 0.1 +F=sinh(x) +C=MpfrFloat::sinh(d2r(x)) diff --git a/tests/02unit_functions/sinl b/tests/02unit_functions/sinl new file mode 100644 index 0000000..0506893 --- /dev/null +++ b/tests/02unit_functions/sinl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-40000, 40000, 5 +F=sin(x) +C=sinl(x) diff --git a/tests/02unit_functions/sinl_deg b/tests/02unit_functions/sinl_deg new file mode 100644 index 0000000..1549d2a --- /dev/null +++ b/tests/02unit_functions/sinl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-40000, 40000, 5 +F=sin(x) +C=sinl(d2r(x)) diff --git a/tests/02unit_functions/sinm b/tests/02unit_functions/sinm new file mode 100644 index 0000000..9eb826f --- /dev/null +++ b/tests/02unit_functions/sinm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-40000, 40000, 5 +F=sin(x) +C=MpfrFloat::sin(x) diff --git a/tests/02unit_functions/sinm_deg b/tests/02unit_functions/sinm_deg new file mode 100644 index 0000000..a6c6a9e --- /dev/null +++ b/tests/02unit_functions/sinm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-40000, 40000, 5 +F=sin(x) +C=MpfrFloat::sin(d2r(x)) diff --git a/tests/02unit_functions/sqrt b/tests/02unit_functions/sqrt new file mode 100644 index 0000000..2d1e4a3 --- /dev/null +++ b/tests/02unit_functions/sqrt @@ -0,0 +1,5 @@ +T=d +V=x +R=0, 100000, 1000 +F=sqrt(x) +C=sqrt(x) diff --git a/tests/02unit_functions/sqrt_cd b/tests/02unit_functions/sqrt_cd new file mode 100644 index 0000000..5630710 --- /dev/null +++ b/tests/02unit_functions/sqrt_cd @@ -0,0 +1,5 @@ +T=cd cf +V=x +R=-100000, 100000, 1000 +F=sqrt(x) +C=std::sqrt(x) diff --git a/tests/02unit_functions/sqrtf b/tests/02unit_functions/sqrtf new file mode 100644 index 0000000..a7f596d --- /dev/null +++ b/tests/02unit_functions/sqrtf @@ -0,0 +1,5 @@ +T=f +V=x +R=0, 100000, 1000 +F=sqrt(x) +C=sqrtf(x) diff --git a/tests/02unit_functions/sqrtl b/tests/02unit_functions/sqrtl new file mode 100644 index 0000000..c3e40d1 --- /dev/null +++ b/tests/02unit_functions/sqrtl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0, 100000, 1000 +F=sqrt(x) +C=sqrtl(x) diff --git a/tests/02unit_functions/sqrtm b/tests/02unit_functions/sqrtm new file mode 100644 index 0000000..1b83272 --- /dev/null +++ b/tests/02unit_functions/sqrtm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0, 100000, 1000 +F=sqrt(x) +C=MpfrFloat::sqrt(x) diff --git a/tests/02unit_functions/tan b/tests/02unit_functions/tan new file mode 100644 index 0000000..13ae12f --- /dev/null +++ b/tests/02unit_functions/tan @@ -0,0 +1,5 @@ +T=d +V=x +R=-1.3, 1.3, 0.05 +F=tan(x) +C=tan(x) diff --git a/tests/02unit_functions/tan_deg b/tests/02unit_functions/tan_deg new file mode 100644 index 0000000..11e372a --- /dev/null +++ b/tests/02unit_functions/tan_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-89, 89, 0.25 +F=tan(x) +C=tan(d2r(x)) diff --git a/tests/02unit_functions/tanf b/tests/02unit_functions/tanf new file mode 100644 index 0000000..0ec3988 --- /dev/null +++ b/tests/02unit_functions/tanf @@ -0,0 +1,5 @@ +T=f +V=x +R=-1.3, 1.3, 0.05 +F=tan(x) +C=tanf(x) diff --git a/tests/02unit_functions/tanf_deg b/tests/02unit_functions/tanf_deg new file mode 100644 index 0000000..16de0db --- /dev/null +++ b/tests/02unit_functions/tanf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-89, 89, 0.25 +F=tan(x) +C=tanf(d2r(x)) diff --git a/tests/02unit_functions/tanh b/tests/02unit_functions/tanh new file mode 100644 index 0000000..dd033c4 --- /dev/null +++ b/tests/02unit_functions/tanh @@ -0,0 +1,5 @@ +T=d +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=tanh(x) diff --git a/tests/02unit_functions/tanh_deg b/tests/02unit_functions/tanh_deg new file mode 100644 index 0000000..b0d251d --- /dev/null +++ b/tests/02unit_functions/tanh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=tanh(d2r(x)) diff --git a/tests/02unit_functions/tanhf b/tests/02unit_functions/tanhf new file mode 100644 index 0000000..d0b930b --- /dev/null +++ b/tests/02unit_functions/tanhf @@ -0,0 +1,5 @@ +T=f +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=tanhf(x) diff --git a/tests/02unit_functions/tanhf_deg b/tests/02unit_functions/tanhf_deg new file mode 100644 index 0000000..7c8d276 --- /dev/null +++ b/tests/02unit_functions/tanhf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=tanhf(d2r(x)) diff --git a/tests/02unit_functions/tanhl b/tests/02unit_functions/tanhl new file mode 100644 index 0000000..d615f1f --- /dev/null +++ b/tests/02unit_functions/tanhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=tanhl(x) diff --git a/tests/02unit_functions/tanhl_deg b/tests/02unit_functions/tanhl_deg new file mode 100644 index 0000000..05e23e7 --- /dev/null +++ b/tests/02unit_functions/tanhl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=tanhl(d2r(x)) diff --git a/tests/02unit_functions/tanhm b/tests/02unit_functions/tanhm new file mode 100644 index 0000000..93c7f7d --- /dev/null +++ b/tests/02unit_functions/tanhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=MpfrFloat::tanh(x) diff --git a/tests/02unit_functions/tanhm_deg b/tests/02unit_functions/tanhm_deg new file mode 100644 index 0000000..c2fc737 --- /dev/null +++ b/tests/02unit_functions/tanhm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-40000, 40000, 5 +F=tanh(x) +C=MpfrFloat::tanh(d2r(x)) diff --git a/tests/02unit_functions/tanl b/tests/02unit_functions/tanl new file mode 100644 index 0000000..a5e8778 --- /dev/null +++ b/tests/02unit_functions/tanl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-1.3, 1.3, 0.05 +F=tan(x) +C=tanl(x) diff --git a/tests/02unit_functions/tanl_deg b/tests/02unit_functions/tanl_deg new file mode 100644 index 0000000..e1ffba5 --- /dev/null +++ b/tests/02unit_functions/tanl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=-89, 89, 0.25 +F=tan(x) +C=tanl(d2r(x)) diff --git a/tests/02unit_functions/tanm b/tests/02unit_functions/tanm new file mode 100644 index 0000000..90d96d2 --- /dev/null +++ b/tests/02unit_functions/tanm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-1.3, 1.3, 0.05 +F=tan(x) +C=MpfrFloat::tan(x) diff --git a/tests/02unit_functions/tanm_deg b/tests/02unit_functions/tanm_deg new file mode 100644 index 0000000..447e3f3 --- /dev/null +++ b/tests/02unit_functions/tanm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=-89, 89, 0.25 +F=tan(x) +C=MpfrFloat::tan(d2r(x)) diff --git a/tests/02unit_functions/trunc b/tests/02unit_functions/trunc new file mode 100644 index 0000000..749cbb8 --- /dev/null +++ b/tests/02unit_functions/trunc @@ -0,0 +1,5 @@ +T=d +V=x +R=-4000, 4000, 0.1 +F=trunc(x) +C=x<0 ? ceil(x) : floor(x) diff --git a/tests/02unit_functions/truncf b/tests/02unit_functions/truncf new file mode 100644 index 0000000..eb9435f --- /dev/null +++ b/tests/02unit_functions/truncf @@ -0,0 +1,5 @@ +T=f +V=x +R=-400, 400, 0.1 +F=trunc(x) +C=fp_trunc(x) diff --git a/tests/02unit_functions/truncl b/tests/02unit_functions/truncl new file mode 100644 index 0000000..4bb3bec --- /dev/null +++ b/tests/02unit_functions/truncl @@ -0,0 +1,5 @@ +T=ld +V=x +R=-400, 400, 0.1 +F=trunc(x) +C=fp_trunc(x) diff --git a/tests/02unit_functions/truncm b/tests/02unit_functions/truncm new file mode 100644 index 0000000..2d539cc --- /dev/null +++ b/tests/02unit_functions/truncm @@ -0,0 +1,5 @@ +T=mf +V=x +R=-400, 400, 0.1 +F=trunc(x) +C=MpfrFloat::trunc(x) diff --git a/tests/03unit_constants/e_d b/tests/03unit_constants/e_d new file mode 100644 index 0000000..fc7f398 --- /dev/null +++ b/tests/03unit_constants/e_d @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=x*0+ naturalnumber +C=exp(x*0+1) diff --git a/tests/03unit_constants/e_f b/tests/03unit_constants/e_f new file mode 100644 index 0000000..af152cb --- /dev/null +++ b/tests/03unit_constants/e_f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=x*0+ naturalnumber +C=expf(x*0+1) diff --git a/tests/03unit_constants/e_ld b/tests/03unit_constants/e_ld new file mode 100644 index 0000000..6547d34 --- /dev/null +++ b/tests/03unit_constants/e_ld @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=x*0+ naturalnumber +C=expl(x*0+1) diff --git a/tests/03unit_constants/e_mpfr b/tests/03unit_constants/e_mpfr new file mode 100644 index 0000000..9c51f2f --- /dev/null +++ b/tests/03unit_constants/e_mpfr @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=x*0+ naturalnumber +C=MpfrFloat::exp(x*0+1) diff --git a/tests/03unit_constants/l10_d b/tests/03unit_constants/l10_d new file mode 100644 index 0000000..d709e72 --- /dev/null +++ b/tests/03unit_constants/l10_d @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=x*0+ logten +C=log(x*0+10) diff --git a/tests/03unit_constants/l10_f b/tests/03unit_constants/l10_f new file mode 100644 index 0000000..b970ee5 --- /dev/null +++ b/tests/03unit_constants/l10_f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=x*0+ logten +C=logf(x*0+10) diff --git a/tests/03unit_constants/l10_ld b/tests/03unit_constants/l10_ld new file mode 100644 index 0000000..fb18983 --- /dev/null +++ b/tests/03unit_constants/l10_ld @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=x*0+ logten +C=logl(x*0+10) diff --git a/tests/03unit_constants/l10_mpfr b/tests/03unit_constants/l10_mpfr new file mode 100644 index 0000000..b4cb87d --- /dev/null +++ b/tests/03unit_constants/l10_mpfr @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=x*0+ logten +C=MpfrFloat::log(x*0+10) diff --git a/tests/03unit_constants/l2_d b/tests/03unit_constants/l2_d new file mode 100644 index 0000000..5a36bd7 --- /dev/null +++ b/tests/03unit_constants/l2_d @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=x*0+ logtwo +C=log(x*0+2) diff --git a/tests/03unit_constants/l2_f b/tests/03unit_constants/l2_f new file mode 100644 index 0000000..8039ce0 --- /dev/null +++ b/tests/03unit_constants/l2_f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=x*0+ logtwo +C=logf(x*0+2) diff --git a/tests/03unit_constants/l2_ld b/tests/03unit_constants/l2_ld new file mode 100644 index 0000000..b208600 --- /dev/null +++ b/tests/03unit_constants/l2_ld @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=x*0+ logtwo +C=logl(x*0+2) diff --git a/tests/03unit_constants/l2_mpfr b/tests/03unit_constants/l2_mpfr new file mode 100644 index 0000000..e07c4a6 --- /dev/null +++ b/tests/03unit_constants/l2_mpfr @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=x*0+ logtwo +C=MpfrFloat::log(x*0+2) diff --git a/tests/03unit_constants/pi_d b/tests/03unit_constants/pi_d new file mode 100644 index 0000000..a2f442d --- /dev/null +++ b/tests/03unit_constants/pi_d @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=x*0+ pi +C=atan2(x*0,-1) diff --git a/tests/03unit_constants/pi_f b/tests/03unit_constants/pi_f new file mode 100644 index 0000000..d790d10 --- /dev/null +++ b/tests/03unit_constants/pi_f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=x*0+ pi +C=atan2f(x*0,-1) diff --git a/tests/03unit_constants/pi_ld b/tests/03unit_constants/pi_ld new file mode 100644 index 0000000..a0506a7 --- /dev/null +++ b/tests/03unit_constants/pi_ld @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=x*0+ pi +C=atan2l(x*0,-1) diff --git a/tests/03unit_constants/pi_mpfr b/tests/03unit_constants/pi_mpfr new file mode 100644 index 0000000..7e6c103 --- /dev/null +++ b/tests/03unit_constants/pi_mpfr @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=x*0+ pi +C=MpfrFloat::atan2(x*0,-1) diff --git a/tests/10optimizer_bytecode/abs b/tests/10optimizer_bytecode/abs new file mode 100644 index 0000000..a1b4f15 --- /dev/null +++ b/tests/10optimizer_bytecode/abs @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x +R=0,1,1 +F=(abs(-3))+x +C=(3)+x diff --git a/tests/10optimizer_bytecode/abscos b/tests/10optimizer_bytecode/abscos new file mode 100644 index 0000000..b80367a --- /dev/null +++ b/tests/10optimizer_bytecode/abscos @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=cos(abs(x)) +C=fp_cos(fp_abs(x)) diff --git a/tests/10optimizer_bytecode/abscosh b/tests/10optimizer_bytecode/abscosh new file mode 100644 index 0000000..7a9a36d --- /dev/null +++ b/tests/10optimizer_bytecode/abscosh @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=cosh(abs(x)) +C=fp_cosh(fp_abs(x)) diff --git a/tests/10optimizer_bytecode/abseq0 b/tests/10optimizer_bytecode/abseq0 new file mode 100644 index 0000000..b0caf58 --- /dev/null +++ b/tests/10optimizer_bytecode/abseq0 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(abs(x)=0) + (0=abs(x)) +C=fp_equal(fp_abs(x),0) + fp_equal(0,fp_abs(x)) diff --git a/tests/10optimizer_bytecode/absevenconstpow b/tests/10optimizer_bytecode/absevenconstpow new file mode 100644 index 0000000..c1798d8 --- /dev/null +++ b/tests/10optimizer_bytecode/absevenconstpow @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=0.001, 0.9, 0.01 +F=abs(x) ^ 1506 +C=fp_pow(fp_abs(x), 1506) diff --git a/tests/10optimizer_bytecode/absmulevenconstpow b/tests/10optimizer_bytecode/absmulevenconstpow new file mode 100644 index 0000000..af7d799 --- /dev/null +++ b/tests/10optimizer_bytecode/absmulevenconstpow @@ -0,0 +1,5 @@ +T=d f ld +V=x,y +R=0.001, 0.9, 0.01 +F=(abs(x)*y) ^ 1506 +C=fp_pow(fp_abs(x)*y, 1506) diff --git a/tests/10optimizer_bytecode/absneq0 b/tests/10optimizer_bytecode/absneq0 new file mode 100644 index 0000000..b0caf58 --- /dev/null +++ b/tests/10optimizer_bytecode/absneq0 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(abs(x)=0) + (0=abs(x)) +C=fp_equal(fp_abs(x),0) + fp_equal(0,fp_abs(x)) diff --git a/tests/10optimizer_bytecode/absneverneg b/tests/10optimizer_bytecode/absneverneg new file mode 100644 index 0000000..2469efe --- /dev/null +++ b/tests/10optimizer_bytecode/absneverneg @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.25 +F=abs(acos(x)) +C=fp_acos(x) diff --git a/tests/10optimizer_bytecode/absnot b/tests/10optimizer_bytecode/absnot new file mode 100644 index 0000000..e52a7dd --- /dev/null +++ b/tests/10optimizer_bytecode/absnot @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=!(abs(x)) +C=fp_not(fp_abs(x)) diff --git a/tests/10optimizer_bytecode/absnot2 b/tests/10optimizer_bytecode/absnot2 new file mode 100644 index 0000000..6a8c53a --- /dev/null +++ b/tests/10optimizer_bytecode/absnot2 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.25 +F=!acos(x) +C=fp_not(fp_acos(x)) diff --git a/tests/10optimizer_bytecode/absnot3 b/tests/10optimizer_bytecode/absnot3 new file mode 100644 index 0000000..8e1ce3c --- /dev/null +++ b/tests/10optimizer_bytecode/absnot3 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-1,1,0.25 +F=!(!(x&y)) +C=fp_not(fp_not(fp_and(x,y))) diff --git a/tests/10optimizer_bytecode/absnot4 b/tests/10optimizer_bytecode/absnot4 new file mode 100644 index 0000000..729e7e4 --- /dev/null +++ b/tests/10optimizer_bytecode/absnot4 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.25 +F=!(!acos(x)) +C=fp_not(fp_not(fp_acos(x))) diff --git a/tests/10optimizer_bytecode/absnotnotnot b/tests/10optimizer_bytecode/absnotnotnot new file mode 100644 index 0000000..eb45d70 --- /dev/null +++ b/tests/10optimizer_bytecode/absnotnotnot @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=!(!!((x*x))) +C=fp_not(fp_notNot((x*x))) diff --git a/tests/10optimizer_bytecode/absnzge b/tests/10optimizer_bytecode/absnzge new file mode 100644 index 0000000..9c8d288 --- /dev/null +++ b/tests/10optimizer_bytecode/absnzge @@ -0,0 +1,5 @@ +T=d li gi +V=x +R=-5,5,1 +F=sub(abs(x) >= 4, abs(x) >= 0) +C=userDefFuncSub({fp_greaterOrEq(fp_abs(x),4), fp_greaterOrEq(fp_abs(x),0)}) diff --git a/tests/10optimizer_bytecode/absnzlt b/tests/10optimizer_bytecode/absnzlt new file mode 100644 index 0000000..2618341 --- /dev/null +++ b/tests/10optimizer_bytecode/absnzlt @@ -0,0 +1,5 @@ +T=d li gi +V=x +R=-5,5,1 +F=sub(abs(x) < 4, abs(x) < 0) +C=userDefFuncSub({fp_less(fp_abs(x),4), fp_less(fp_abs(x),0)}) diff --git a/tests/10optimizer_bytecode/abssqr b/tests/10optimizer_bytecode/abssqr new file mode 100644 index 0000000..5265f05 --- /dev/null +++ b/tests/10optimizer_bytecode/abssqr @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=abs(x)*abs(x) +C=x*x diff --git a/tests/10optimizer_bytecode/absyxpow_neg b/tests/10optimizer_bytecode/absyxpow_neg new file mode 100644 index 0000000..c6fb507 --- /dev/null +++ b/tests/10optimizer_bytecode/absyxpow_neg @@ -0,0 +1,6 @@ +# y [isEvenInteger(y)&&!isEvenInteger(x*y)] cPow x cPow +T=d +V=x +R=-10,10,0.1 +F=(x^-4)^1.5 +C=fp_pow(fp_pow(x,-4),1.5) diff --git a/tests/10optimizer_bytecode/absyxpow_pos b/tests/10optimizer_bytecode/absyxpow_pos new file mode 100644 index 0000000..7547b25 --- /dev/null +++ b/tests/10optimizer_bytecode/absyxpow_pos @@ -0,0 +1,6 @@ +# y [isEvenInteger(y)&&!isEvenInteger(x*y)] cPow x cPow +T=d +V=x +R=-10,10,0.1 +F=(x^4)^1.5 +C=fp_pow(fp_pow(x,4),1.5) diff --git a/tests/10optimizer_bytecode/acos b/tests/10optimizer_bytecode/acos new file mode 100644 index 0000000..59ed768 --- /dev/null +++ b/tests/10optimizer_bytecode/acos @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=acos(0.7)+x +C=acos(0.7)+x diff --git a/tests/10optimizer_bytecode/acos_deg b/tests/10optimizer_bytecode/acos_deg new file mode 100644 index 0000000..f90ad1c --- /dev/null +++ b/tests/10optimizer_bytecode/acos_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=acos(0.7)+x +C=r2d(acos(0.7))+x diff --git a/tests/10optimizer_bytecode/acosf b/tests/10optimizer_bytecode/acosf new file mode 100644 index 0000000..6688f9e --- /dev/null +++ b/tests/10optimizer_bytecode/acosf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=acos(0.7)+x +C=acosf(0.7)+x diff --git a/tests/10optimizer_bytecode/acosf_deg b/tests/10optimizer_bytecode/acosf_deg new file mode 100644 index 0000000..04d94ae --- /dev/null +++ b/tests/10optimizer_bytecode/acosf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=acos(0.7)+x +C=r2d(acosf(0.7))+x diff --git a/tests/10optimizer_bytecode/acosh b/tests/10optimizer_bytecode/acosh new file mode 100644 index 0000000..73fa76b --- /dev/null +++ b/tests/10optimizer_bytecode/acosh @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=acosh(1.1)+x +C=log(1.1 + sqrt(1.1*1.1 - 1))+x diff --git a/tests/10optimizer_bytecode/acosh_deg b/tests/10optimizer_bytecode/acosh_deg new file mode 100644 index 0000000..58631ba --- /dev/null +++ b/tests/10optimizer_bytecode/acosh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=acosh(1.1)+x +C=r2d(log(1.1 + sqrt(1.1*1.1 - 1)))+x diff --git a/tests/10optimizer_bytecode/acoshcosh b/tests/10optimizer_bytecode/acoshcosh new file mode 100644 index 0000000..6ffcc99 --- /dev/null +++ b/tests/10optimizer_bytecode/acoshcosh @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=1,3,0.1 +F=cosh(acosh(x)) +C=fp_cosh(fp_acosh(x)) diff --git a/tests/10optimizer_bytecode/acoshf b/tests/10optimizer_bytecode/acoshf new file mode 100644 index 0000000..b15b9f2 --- /dev/null +++ b/tests/10optimizer_bytecode/acoshf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=acosh(1.1)+x +C=logf(1.1 + sqrtf(1.1*1.1 - 1))+x diff --git a/tests/10optimizer_bytecode/acoshf_deg b/tests/10optimizer_bytecode/acoshf_deg new file mode 100644 index 0000000..973eaeb --- /dev/null +++ b/tests/10optimizer_bytecode/acoshf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=acosh(1.1)+x +C=r2d(fp_acosh(1.1))+x diff --git a/tests/10optimizer_bytecode/acoshl b/tests/10optimizer_bytecode/acoshl new file mode 100644 index 0000000..6ebbaf4 --- /dev/null +++ b/tests/10optimizer_bytecode/acoshl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=acosh(1.1)+x +C=logl(1.1 + sqrtl(1.1*1.1 - 1))+x diff --git a/tests/10optimizer_bytecode/acoshl_deg b/tests/10optimizer_bytecode/acoshl_deg new file mode 100644 index 0000000..f5f494f --- /dev/null +++ b/tests/10optimizer_bytecode/acoshl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=acosh(1.1)+x +C=r2d(fp_acosh(1.1))+x diff --git a/tests/10optimizer_bytecode/acoshm b/tests/10optimizer_bytecode/acoshm new file mode 100644 index 0000000..b75b254 --- /dev/null +++ b/tests/10optimizer_bytecode/acoshm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=acosh(1.1)+x +C=MpfrFloat::acosh(1.1)+x diff --git a/tests/10optimizer_bytecode/acoshm_deg b/tests/10optimizer_bytecode/acoshm_deg new file mode 100644 index 0000000..09a7aaf --- /dev/null +++ b/tests/10optimizer_bytecode/acoshm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=acosh(1.1)+x +C=r2d(MpfrFloat::acosh(1.1))+x diff --git a/tests/10optimizer_bytecode/acoshsinh b/tests/10optimizer_bytecode/acoshsinh new file mode 100644 index 0000000..eb9fa21 --- /dev/null +++ b/tests/10optimizer_bytecode/acoshsinh @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=1.7, 3.7, 0.28 +F=sinh(acosh(x)) +C=fp_sinh(fp_acosh(x)) diff --git a/tests/10optimizer_bytecode/acosl b/tests/10optimizer_bytecode/acosl new file mode 100644 index 0000000..8d30758 --- /dev/null +++ b/tests/10optimizer_bytecode/acosl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=acos(0.7)+x +C=acosl(0.7)+x diff --git a/tests/10optimizer_bytecode/acosl_deg b/tests/10optimizer_bytecode/acosl_deg new file mode 100644 index 0000000..0e9c458 --- /dev/null +++ b/tests/10optimizer_bytecode/acosl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=acos(0.7)+x +C=r2d(acosl(0.7))+x diff --git a/tests/10optimizer_bytecode/acosm b/tests/10optimizer_bytecode/acosm new file mode 100644 index 0000000..fef677e --- /dev/null +++ b/tests/10optimizer_bytecode/acosm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=acos(0.7)+x +C=MpfrFloat::acos(0.7)+x diff --git a/tests/10optimizer_bytecode/acosm_deg b/tests/10optimizer_bytecode/acosm_deg new file mode 100644 index 0000000..ec5b146 --- /dev/null +++ b/tests/10optimizer_bytecode/acosm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=acos(0.7)+x +C=r2d(MpfrFloat::acos(0.7))+x diff --git a/tests/10optimizer_bytecode/add b/tests/10optimizer_bytecode/add new file mode 100644 index 0000000..7f7753b --- /dev/null +++ b/tests/10optimizer_bytecode/add @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=5+3+x +C=5+3+x diff --git a/tests/10optimizer_bytecode/add0 b/tests/10optimizer_bytecode/add0 new file mode 100644 index 0000000..66d1e9c --- /dev/null +++ b/tests/10optimizer_bytecode/add0 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=x+0+x +C=x+0+x diff --git a/tests/10optimizer_bytecode/addexp b/tests/10optimizer_bytecode/addexp new file mode 100644 index 0000000..b245a1c --- /dev/null +++ b/tests/10optimizer_bytecode/addexp @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-3,-3,0.7 +F=exp(x+4) +C=fp_exp(x+4) diff --git a/tests/10optimizer_bytecode/addexp2 b/tests/10optimizer_bytecode/addexp2 new file mode 100644 index 0000000..8a6174c --- /dev/null +++ b/tests/10optimizer_bytecode/addexp2 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-3,-3,0.7 +F=exp2(x+4) +C=fp_exp2(x+4) diff --git a/tests/10optimizer_bytecode/and b/tests/10optimizer_bytecode/and new file mode 100644 index 0000000..908d1df --- /dev/null +++ b/tests/10optimizer_bytecode/and @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5&3)+x+(5&0)+(0&5)+(0&0) +C=fp_and(5,3)+x+fp_and(5,0)+fp_and(0,5)+fp_and(0,0) diff --git a/tests/10optimizer_bytecode/asin b/tests/10optimizer_bytecode/asin new file mode 100644 index 0000000..4a1c56c --- /dev/null +++ b/tests/10optimizer_bytecode/asin @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=asin(0.7)+x +C=asin(0.7)+x diff --git a/tests/10optimizer_bytecode/asin_deg b/tests/10optimizer_bytecode/asin_deg new file mode 100644 index 0000000..4dc059c --- /dev/null +++ b/tests/10optimizer_bytecode/asin_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=asin(0.7)+x +C=r2d(asin(0.7))+x diff --git a/tests/10optimizer_bytecode/asinf b/tests/10optimizer_bytecode/asinf new file mode 100644 index 0000000..093d5e2 --- /dev/null +++ b/tests/10optimizer_bytecode/asinf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=asin(0.7)+x +C=asinf(0.7)+x diff --git a/tests/10optimizer_bytecode/asinf_deg b/tests/10optimizer_bytecode/asinf_deg new file mode 100644 index 0000000..5488122 --- /dev/null +++ b/tests/10optimizer_bytecode/asinf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=asin(0.7)+x +C=r2d(asinf(0.7))+x diff --git a/tests/10optimizer_bytecode/asinh b/tests/10optimizer_bytecode/asinh new file mode 100644 index 0000000..e4eb54f --- /dev/null +++ b/tests/10optimizer_bytecode/asinh @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=asinh(1.1)+x +C=log(1.1 + sqrt(1.1*1.1+1))+x diff --git a/tests/10optimizer_bytecode/asinh_deg b/tests/10optimizer_bytecode/asinh_deg new file mode 100644 index 0000000..e01a3a6 --- /dev/null +++ b/tests/10optimizer_bytecode/asinh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=asinh(1.1)+x +C=r2d(log(1.1 + sqrt(1.1*1.1+1)))+x diff --git a/tests/10optimizer_bytecode/asinhcosh b/tests/10optimizer_bytecode/asinhcosh new file mode 100644 index 0000000..a828791 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhcosh @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-0.7, 0.7, 0.28 +F=cosh(asinh(x)) +C=fp_cosh(fp_asinh(x)) diff --git a/tests/10optimizer_bytecode/asinhf b/tests/10optimizer_bytecode/asinhf new file mode 100644 index 0000000..deaad73 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=asinh(1.1)+x +C=logf(1.1 + sqrtf(1.1*1.1+1))+x diff --git a/tests/10optimizer_bytecode/asinhf_deg b/tests/10optimizer_bytecode/asinhf_deg new file mode 100644 index 0000000..da25424 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=asinh(1.1)+x +C=r2d(fp_asinh(1.1))+x diff --git a/tests/10optimizer_bytecode/asinhl b/tests/10optimizer_bytecode/asinhl new file mode 100644 index 0000000..3d5c661 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=asinh(1.1)+x +C=logl(1.1 + sqrtl(1.1*1.1+1))+x diff --git a/tests/10optimizer_bytecode/asinhl_deg b/tests/10optimizer_bytecode/asinhl_deg new file mode 100644 index 0000000..66a60a8 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=asinh(1.1)+x +C=r2d(fp_asinh(1.1))+x diff --git a/tests/10optimizer_bytecode/asinhm b/tests/10optimizer_bytecode/asinhm new file mode 100644 index 0000000..b7a9e27 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=asinh(1.1)+x +C=MpfrFloat::asinh(1.1)+x diff --git a/tests/10optimizer_bytecode/asinhm_deg b/tests/10optimizer_bytecode/asinhm_deg new file mode 100644 index 0000000..efef4f8 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=asinh(1.1)+x +C=r2d(MpfrFloat::asinh(1.1))+x diff --git a/tests/10optimizer_bytecode/asinhsinh b/tests/10optimizer_bytecode/asinhsinh new file mode 100644 index 0000000..84b37c9 --- /dev/null +++ b/tests/10optimizer_bytecode/asinhsinh @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-3,3,0.1 +F=sinh(asinh(x)) +C=fp_sinh(fp_asinh(x)) diff --git a/tests/10optimizer_bytecode/asinl b/tests/10optimizer_bytecode/asinl new file mode 100644 index 0000000..699680b --- /dev/null +++ b/tests/10optimizer_bytecode/asinl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=asin(0.7)+x +C=asinl(0.7)+x diff --git a/tests/10optimizer_bytecode/asinl_deg b/tests/10optimizer_bytecode/asinl_deg new file mode 100644 index 0000000..d37bf7f --- /dev/null +++ b/tests/10optimizer_bytecode/asinl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=asin(0.7)+x +C=r2d(asinl(0.7))+x diff --git a/tests/10optimizer_bytecode/asinm b/tests/10optimizer_bytecode/asinm new file mode 100644 index 0000000..81a8401 --- /dev/null +++ b/tests/10optimizer_bytecode/asinm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=asin(0.7)+x +C=MpfrFloat::asin(0.7)+x diff --git a/tests/10optimizer_bytecode/asinm_deg b/tests/10optimizer_bytecode/asinm_deg new file mode 100644 index 0000000..889adf0 --- /dev/null +++ b/tests/10optimizer_bytecode/asinm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=asin(0.7)+x +C=r2d(MpfrFloat::asin(0.7))+x diff --git a/tests/10optimizer_bytecode/atan b/tests/10optimizer_bytecode/atan new file mode 100644 index 0000000..6922e58 --- /dev/null +++ b/tests/10optimizer_bytecode/atan @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=atan(1.1)+x +C=atan(1.1)+x diff --git a/tests/10optimizer_bytecode/atan2 b/tests/10optimizer_bytecode/atan2 new file mode 100644 index 0000000..f0515b9 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2 @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=atan2(5,4)+x +C=atan2(5,4)+x diff --git a/tests/10optimizer_bytecode/atan2_deg b/tests/10optimizer_bytecode/atan2_deg new file mode 100644 index 0000000..a4a13e9 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=atan2(5,4)+x +C=r2d(atan2(5,4))+x diff --git a/tests/10optimizer_bytecode/atan2f b/tests/10optimizer_bytecode/atan2f new file mode 100644 index 0000000..515a460 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=atan2(5,4)+x +C=atan2f(5,4)+x diff --git a/tests/10optimizer_bytecode/atan2f_deg b/tests/10optimizer_bytecode/atan2f_deg new file mode 100644 index 0000000..f8c40e7 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2f_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=atan2(5,4)+x +C=r2d(atan2f(5,4))+x diff --git a/tests/10optimizer_bytecode/atan2l b/tests/10optimizer_bytecode/atan2l new file mode 100644 index 0000000..012e131 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2l @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=atan2(5,4)+x +C=atan2l(5,4)+x diff --git a/tests/10optimizer_bytecode/atan2l_deg b/tests/10optimizer_bytecode/atan2l_deg new file mode 100644 index 0000000..d2a8554 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2l_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=atan2(5,4)+x +C=r2d(atan2l(5,4))+x diff --git a/tests/10optimizer_bytecode/atan2m b/tests/10optimizer_bytecode/atan2m new file mode 100644 index 0000000..acfbec0 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2m @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=atan2(5,4)+x +C=MpfrFloat::atan2(5,4)+x diff --git a/tests/10optimizer_bytecode/atan2m_deg b/tests/10optimizer_bytecode/atan2m_deg new file mode 100644 index 0000000..6a6a886 --- /dev/null +++ b/tests/10optimizer_bytecode/atan2m_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=atan2(5,4)+x +C=r2d(MpfrFloat::atan2(5,4))+x diff --git a/tests/10optimizer_bytecode/atan2tan b/tests/10optimizer_bytecode/atan2tan new file mode 100644 index 0000000..ef464de --- /dev/null +++ b/tests/10optimizer_bytecode/atan2tan @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-3,3,0.11 +F=tan(atan2(x,y)) +C=fp_tan(fp_atan2(x,y)) diff --git a/tests/10optimizer_bytecode/atan_deg b/tests/10optimizer_bytecode/atan_deg new file mode 100644 index 0000000..99544ed --- /dev/null +++ b/tests/10optimizer_bytecode/atan_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=atan(1.1)+x +C=r2d(atan(1.1))+x diff --git a/tests/10optimizer_bytecode/atanf b/tests/10optimizer_bytecode/atanf new file mode 100644 index 0000000..2b51d89 --- /dev/null +++ b/tests/10optimizer_bytecode/atanf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=atan(1.1)+x +C=atanf(1.1)+x diff --git a/tests/10optimizer_bytecode/atanf_deg b/tests/10optimizer_bytecode/atanf_deg new file mode 100644 index 0000000..bfdb513 --- /dev/null +++ b/tests/10optimizer_bytecode/atanf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=atan(1.1)+x +C=r2d(atanf(1.1))+x diff --git a/tests/10optimizer_bytecode/atanh b/tests/10optimizer_bytecode/atanh new file mode 100644 index 0000000..3e8b320 --- /dev/null +++ b/tests/10optimizer_bytecode/atanh @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=atanh(0.7)+x +C=log( (1+0.7) / (1-0.7) ) * 0.5+x diff --git a/tests/10optimizer_bytecode/atanhf b/tests/10optimizer_bytecode/atanhf new file mode 100644 index 0000000..e6666fd --- /dev/null +++ b/tests/10optimizer_bytecode/atanhf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=atanh(0.7)+x +C=logf( (1+0.7) / (1-0.7) ) * 0.5+x diff --git a/tests/10optimizer_bytecode/atanhl b/tests/10optimizer_bytecode/atanhl new file mode 100644 index 0000000..5f0943a --- /dev/null +++ b/tests/10optimizer_bytecode/atanhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=atanh(0.7)+x +C=logl( (1+0.7) / (1-0.7) ) * 0.5+x diff --git a/tests/10optimizer_bytecode/atanhm b/tests/10optimizer_bytecode/atanhm new file mode 100644 index 0000000..d8b8ea3 --- /dev/null +++ b/tests/10optimizer_bytecode/atanhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=atanh(0.7)+x +C=MpfrFloat::atanh(0.7)+x diff --git a/tests/10optimizer_bytecode/atanl b/tests/10optimizer_bytecode/atanl new file mode 100644 index 0000000..a173b22 --- /dev/null +++ b/tests/10optimizer_bytecode/atanl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=atan(1.1)+x +C=atanl(1.1)+x diff --git a/tests/10optimizer_bytecode/atanl_deg b/tests/10optimizer_bytecode/atanl_deg new file mode 100644 index 0000000..f1e8793 --- /dev/null +++ b/tests/10optimizer_bytecode/atanl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=atan(1.1)+x +C=r2d(atanl(1.1))+x diff --git a/tests/10optimizer_bytecode/atanm b/tests/10optimizer_bytecode/atanm new file mode 100644 index 0000000..8c9c031 --- /dev/null +++ b/tests/10optimizer_bytecode/atanm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=atan(1.1)+x +C=MpfrFloat::atan(1.1)+x diff --git a/tests/10optimizer_bytecode/atanm_deg b/tests/10optimizer_bytecode/atanm_deg new file mode 100644 index 0000000..1a80979 --- /dev/null +++ b/tests/10optimizer_bytecode/atanm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=atan(1.1)+x +C=r2d(MpfrFloat::atan(1.1))+x diff --git a/tests/10optimizer_bytecode/cbrt b/tests/10optimizer_bytecode/cbrt new file mode 100644 index 0000000..723b4ac --- /dev/null +++ b/tests/10optimizer_bytecode/cbrt @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=cbrt(1.1)+x +C=exp(log(1.1) / 3)+x diff --git a/tests/10optimizer_bytecode/cbrtf b/tests/10optimizer_bytecode/cbrtf new file mode 100644 index 0000000..1c36d2e --- /dev/null +++ b/tests/10optimizer_bytecode/cbrtf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=cbrt(1.1)+x +C=fp_cbrt(1.1)+x diff --git a/tests/10optimizer_bytecode/cbrtl b/tests/10optimizer_bytecode/cbrtl new file mode 100644 index 0000000..0bf390b --- /dev/null +++ b/tests/10optimizer_bytecode/cbrtl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=cbrt(1.1)+x +C=fp_cbrt(1.1)+x diff --git a/tests/10optimizer_bytecode/cbrtm b/tests/10optimizer_bytecode/cbrtm new file mode 100644 index 0000000..81197c7 --- /dev/null +++ b/tests/10optimizer_bytecode/cbrtm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=cbrt(1.1)+x +C=MpfrFloat::cbrt(1.1)+x diff --git a/tests/10optimizer_bytecode/ceil b/tests/10optimizer_bytecode/ceil new file mode 100644 index 0000000..9728f55 --- /dev/null +++ b/tests/10optimizer_bytecode/ceil @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=ceil(1.1)+x +C=ceil(1.1)+x diff --git a/tests/10optimizer_bytecode/ceilf b/tests/10optimizer_bytecode/ceilf new file mode 100644 index 0000000..7279a80 --- /dev/null +++ b/tests/10optimizer_bytecode/ceilf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=ceil(1.1)+x +C=ceilf(1.1)+x diff --git a/tests/10optimizer_bytecode/ceill b/tests/10optimizer_bytecode/ceill new file mode 100644 index 0000000..c409c7e --- /dev/null +++ b/tests/10optimizer_bytecode/ceill @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=ceil(1.1)+x +C=ceill(1.1)+x diff --git a/tests/10optimizer_bytecode/ceilm b/tests/10optimizer_bytecode/ceilm new file mode 100644 index 0000000..de13d1d --- /dev/null +++ b/tests/10optimizer_bytecode/ceilm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=ceil(1.1)+x +C=MpfrFloat::ceil(1.1)+x diff --git a/tests/10optimizer_bytecode/ceilneg b/tests/10optimizer_bytecode/ceilneg new file mode 100644 index 0000000..bb932ff --- /dev/null +++ b/tests/10optimizer_bytecode/ceilneg @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=ceil(-x) +C=fp_ceil(-x) diff --git a/tests/10optimizer_bytecode/cmp_acos b/tests/10optimizer_bytecode/cmp_acos new file mode 100644 index 0000000..a6990e9 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_acos @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=1*(acos(x)=acos(0.75)) + \ + 2*(acos(x)<acos(0.75)) + \ + 4*(acos(x)<=acos(0.75)) + \ + 8*(acos(x)>acos(0.75)) + \ + 16*(acos(x)>=acos(0.75)) + \ + 32*(acos(x)!=acos(0.75)) +C=1*fp_equal(fp_acos(x),fp_acos(0.75)) + \ + 2*fp_less(fp_acos(x),fp_acos(0.75)) + \ + 4*fp_lessOrEq(fp_acos(x),fp_acos(0.75)) + \ + 8*fp_greater(fp_acos(x),fp_acos(0.75)) + \ + 16*fp_greaterOrEq(fp_acos(x),fp_acos(0.75)) + \ + 32*fp_nequal(fp_acos(x),fp_acos(0.75)) diff --git a/tests/10optimizer_bytecode/cmp_acos_outrange b/tests/10optimizer_bytecode/cmp_acos_outrange new file mode 100644 index 0000000..5e7cbe8 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_acos_outrange @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=1*(acos(x)=2) + \ + 2*(acos(x)<2) + \ + 4*(acos(x)<=2) + \ + 8*(acos(x)>2) + \ + 16*(acos(x)>=2) + \ + 32*(acos(x)!=2) +C=1*fp_equal(fp_acos(x),2) + \ + 2*fp_less(fp_acos(x),2) + \ + 4*fp_lessOrEq(fp_acos(x),2) + \ + 8*fp_greater(fp_acos(x),2) + \ + 16*fp_greaterOrEq(fp_acos(x),2) + \ + 32*fp_nequal(fp_acos(x),2) diff --git a/tests/10optimizer_bytecode/cmp_add b/tests/10optimizer_bytecode/cmp_add new file mode 100644 index 0000000..a6c1b1c --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_add @@ -0,0 +1,15 @@ +T=d f ld li +V=x +R=-10,10,1 +F=1*((1-x+x+5)=4) +\ + 2*((1-x+x+5)<4) +\ + 4*((1-x+x+5)<=4) +\ + 8*((1-x+x+5)>4) +\ + 16*((1-x+x+5)>=4) +\ + 32*((1-x+x+5)!=4) +C=1*fp_equal((1-x+x+5),4) +\ + 2*fp_less((1-x+x+5),4) +\ + 4*fp_lessOrEq((1-x+x+5),4) +\ + 8*fp_greater((1-x+x+5),4) +\ + 16*fp_greaterOrEq((1-x+x+5),4) +\ + 32*fp_nequal((1-x+x+5),4) diff --git a/tests/10optimizer_bytecode/cmp_asin b/tests/10optimizer_bytecode/cmp_asin new file mode 100644 index 0000000..7f7e99b --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_asin @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=1*(asin(x)=asin(0.75)) + \ + 2*(asin(x)<asin(0.75)) + \ + 4*(asin(x)<=asin(0.75)) + \ + 8*(asin(x)>asin(0.75)) + \ + 16*(asin(x)>=asin(0.75)) + \ + 32*(asin(x)!=asin(0.75)) +C=1*fp_equal(fp_asin(x),fp_asin(0.75)) + \ + 2*fp_less(fp_asin(x),fp_asin(0.75)) + \ + 4*fp_lessOrEq(fp_asin(x),fp_asin(0.75)) + \ + 8*fp_greater(fp_asin(x),fp_asin(0.75)) + \ + 16*fp_greaterOrEq(fp_asin(x),fp_asin(0.75)) + \ + 32*fp_nequal(fp_asin(x),fp_asin(0.75)) diff --git a/tests/10optimizer_bytecode/cmp_asin_outrange b/tests/10optimizer_bytecode/cmp_asin_outrange new file mode 100644 index 0000000..576de83 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_asin_outrange @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=1*(asin(x)=2) + \ + 2*(asin(x)<2) + \ + 4*(asin(x)<=2) + \ + 8*(asin(x)>2) + \ + 16*(asin(x)>=2) + \ + 32*(asin(x)!=2) +C=1*fp_equal(fp_asin(x),2) + \ + 2*fp_less(fp_asin(x),2) + \ + 4*fp_lessOrEq(fp_asin(x),2) + \ + 8*fp_greater(fp_asin(x),2) + \ + 16*fp_greaterOrEq(fp_asin(x),2) + \ + 32*fp_nequal(fp_asin(x),2) diff --git a/tests/10optimizer_bytecode/cmp_atan b/tests/10optimizer_bytecode/cmp_atan new file mode 100644 index 0000000..4353b03 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_atan @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(atan(x)=atan(2)) + \ + 2*(atan(x)<atan(2)) + \ + 4*(atan(x)<=atan(2)) + \ + 8*(atan(x)>atan(2)) + \ + 16*(atan(x)>=atan(2)) + \ + 32*(atan(x)!=atan(2)) +C=1*fp_equal(fp_atan(x),fp_atan(2)) + \ + 2*fp_less(fp_atan(x),fp_atan(2)) + \ + 4*fp_lessOrEq(fp_atan(x),fp_atan(2)) + \ + 8*fp_greater(fp_atan(x),fp_atan(2)) + \ + 16*fp_greaterOrEq(fp_atan(x),fp_atan(2)) + \ + 32*fp_nequal(fp_atan(x),fp_atan(2)) diff --git a/tests/10optimizer_bytecode/cmp_exp b/tests/10optimizer_bytecode/cmp_exp new file mode 100644 index 0000000..1c18b6d --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_exp @@ -0,0 +1,7 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(exp(x)=exp(2)) + 2*(exp(x)<exp(2)) + 4*(exp(x)<=exp(2)) + \ + 8*(exp(x)>exp(2)) + 16*(exp(x)>=exp(2)) + 32*(exp(x)!=exp(2)) +C=1*fp_equal(fp_exp(x),fp_exp(2)) + 2*fp_less(fp_exp(x),fp_exp(2)) + 4*fp_lessOrEq(fp_exp(x),fp_exp(2)) + \ + 8*fp_greater(fp_exp(x),fp_exp(2)) + 16*fp_greaterOrEq(fp_exp(x),fp_exp(2)) + 32*fp_nequal(fp_exp(x),fp_exp(2)) diff --git a/tests/10optimizer_bytecode/cmp_exp2 b/tests/10optimizer_bytecode/cmp_exp2 new file mode 100644 index 0000000..7ddae26 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_exp2 @@ -0,0 +1,7 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(exp2(x)=exp2(2)) + 2*(exp2(x)<exp2(2)) + 4*(exp2(x)<=exp2(2)) + \ + 8*(exp2(x)>exp2(2)) + 16*(exp2(x)>=exp2(2)) + 32*(exp2(x)!=exp2(2)) +C=1*fp_equal(fp_exp2(x),fp_exp2(2)) + 2*fp_less(fp_exp2(x),fp_exp2(2)) + 4*fp_lessOrEq(fp_exp2(x),fp_exp2(2)) + \ + 8*fp_greater(fp_exp2(x),fp_exp2(2)) + 16*fp_greaterOrEq(fp_exp2(x),fp_exp2(2)) + 32*fp_nequal(fp_exp2(x),fp_exp2(2)) diff --git a/tests/10optimizer_bytecode/cmp_exp2_neg b/tests/10optimizer_bytecode/cmp_exp2_neg new file mode 100644 index 0000000..4a70b71 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_exp2_neg @@ -0,0 +1,7 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(exp2(x)=-4) + 2*(exp2(x)<-4) + 4*(exp2(x)<=-4) + \ + 8*(exp2(x)>-4) + 16*(exp2(x)>=-4) + 32*(exp2(x)!=-4) +C=1*fp_equal(fp_exp2(x),-4) + 2*fp_less(fp_exp2(x),-4) + 4*fp_lessOrEq(fp_exp2(x),-4) + \ + 8*fp_greater(fp_exp2(x),-4) + 16*fp_greaterOrEq(fp_exp2(x),-4) + 32*fp_nequal(fp_exp2(x),-4) diff --git a/tests/10optimizer_bytecode/cmp_exp_neg b/tests/10optimizer_bytecode/cmp_exp_neg new file mode 100644 index 0000000..0c90dc4 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_exp_neg @@ -0,0 +1,7 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(exp(x)=-4) + 2*(exp(x)<-4) + 4*(exp(x)<=-4) + \ + 8*(exp(x)>-4) + 16*(exp(x)>=-4) + 32*(exp(x)!=-4) +C=1*fp_equal(fp_exp(x),-4) + 2*fp_less(fp_exp(x),-4) + 4*fp_lessOrEq(fp_exp(x),-4) + \ + 8*fp_greater(fp_exp(x),-4) + 16*fp_greaterOrEq(fp_exp(x),-4) + 32*fp_nequal(fp_exp(x),-4) diff --git a/tests/10optimizer_bytecode/cmp_log10_nn b/tests/10optimizer_bytecode/cmp_log10_nn new file mode 100644 index 0000000..c3d8edd --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log10_nn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.5,3,0.5 +F=1*(log10(x)=-2) + \ + 2*(log10(x)<-2) + \ + 4*(log10(x)<=-2) + \ + 8*(log10(x)>-2) + \ + 16*(log10(x)>=-2) + \ + 32*(log10(x)!=-2) +C=1*fp_equal(fp_log10(x),-2) + \ + 2*fp_less(fp_log10(x),-2) + \ + 4*fp_lessOrEq(fp_log10(x),-2) + \ + 8*fp_greater(fp_log10(x),-2) + \ + 16*fp_greaterOrEq(fp_log10(x),-2) + \ + 32*fp_nequal(fp_log10(x),-2) diff --git a/tests/10optimizer_bytecode/cmp_log10_np b/tests/10optimizer_bytecode/cmp_log10_np new file mode 100644 index 0000000..bec5116 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log10_np @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.5,3,0.5 +F=1*(log10(x)=log10(2)) + \ + 2*(log10(x)<log10(2)) + \ + 4*(log10(x)<=log10(2)) + \ + 8*(log10(x)>log10(2)) + \ + 16*(log10(x)>=log10(2)) + \ + 32*(log10(x)!=log10(2)) +C=1*fp_equal(fp_log10(x),fp_log10(2)) + \ + 2*fp_less(fp_log10(x),fp_log10(2)) + \ + 4*fp_lessOrEq(fp_log10(x),fp_log10(2)) + \ + 8*fp_greater(fp_log10(x),fp_log10(2)) + \ + 16*fp_greaterOrEq(fp_log10(x),fp_log10(2)) + \ + 32*fp_nequal(fp_log10(x),fp_log10(2)) diff --git a/tests/10optimizer_bytecode/cmp_log10_pn b/tests/10optimizer_bytecode/cmp_log10_pn new file mode 100644 index 0000000..533d10d --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log10_pn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(log10(abs(x))=-2) + \ + 2*(log10(abs(x))<-2) + \ + 4*(log10(abs(x))<=-2) + \ + 8*(log10(abs(x))>-2) + \ + 16*(log10(abs(x))>=-2) + \ + 32*(log10(abs(x))!=-2) +C=1*fp_equal(fp_log10(fp_abs(x)),-2) + \ + 2*fp_less(fp_log10(fp_abs(x)),-2) + \ + 4*fp_lessOrEq(fp_log10(fp_abs(x)),-2) + \ + 8*fp_greater(fp_log10(fp_abs(x)),-2) + \ + 16*fp_greaterOrEq(fp_log10(fp_abs(x)),-2) + \ + 32*fp_nequal(fp_log10(fp_abs(x)),-2) diff --git a/tests/10optimizer_bytecode/cmp_log10_pp b/tests/10optimizer_bytecode/cmp_log10_pp new file mode 100644 index 0000000..821b15b --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log10_pp @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(log10(abs(x))=log10(1)) + \ + 2*(log10(abs(x))<log10(1)) + \ + 4*(log10(abs(x))<=log10(1)) + \ + 8*(log10(abs(x))>log10(1)) + \ + 16*(log10(abs(x))>=log10(1)) + \ + 32*(log10(abs(x))!=log10(1)) +C=1*fp_equal(fp_log10(fp_abs(x)),fp_log10(1)) + \ + 2*fp_less(fp_log10(fp_abs(x)),fp_log10(1)) + \ + 4*fp_lessOrEq(fp_log10(fp_abs(x)),fp_log10(1)) + \ + 8*fp_greater(fp_log10(fp_abs(x)),fp_log10(1)) + \ + 16*fp_greaterOrEq(fp_log10(fp_abs(x)),fp_log10(1)) + \ + 32*fp_nequal(fp_log10(fp_abs(x)),fp_log10(1)) diff --git a/tests/10optimizer_bytecode/cmp_log2_nn b/tests/10optimizer_bytecode/cmp_log2_nn new file mode 100644 index 0000000..34a6bae --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log2_nn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.5,3,0.5 +F=1*(log2(x)=-2) + \ + 2*(log2(x)<-2) + \ + 4*(log2(x)<=-2) + \ + 8*(log2(x)>-2) + \ + 16*(log2(x)>=-2) + \ + 32*(log2(x)!=-2) +C=1*fp_equal(fp_log2(x),-2) + \ + 2*fp_less(fp_log2(x),-2) + \ + 4*fp_lessOrEq(fp_log2(x),-2) + \ + 8*fp_greater(fp_log2(x),-2) + \ + 16*fp_greaterOrEq(fp_log2(x),-2) + \ + 32*fp_nequal(fp_log2(x),-2) diff --git a/tests/10optimizer_bytecode/cmp_log2_np b/tests/10optimizer_bytecode/cmp_log2_np new file mode 100644 index 0000000..f1156b8 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log2_np @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.5,3,0.5 +F=1*(log2(x)=log2(2)) + \ + 2*(log2(x)<log2(2)) + \ + 4*(log2(x)<=log2(2)) + \ + 8*(log2(x)>log2(2)) + \ + 16*(log2(x)>=log2(2)) + \ + 32*(log2(x)!=log2(2)) +C=1*fp_equal(fp_log2(x),fp_log2(2)) + \ + 2*fp_less(fp_log2(x),fp_log2(2)) + \ + 4*fp_lessOrEq(fp_log2(x),fp_log2(2)) + \ + 8*fp_greater(fp_log2(x),fp_log2(2)) + \ + 16*fp_greaterOrEq(fp_log2(x),fp_log2(2)) + \ + 32*fp_nequal(fp_log2(x),fp_log2(2)) diff --git a/tests/10optimizer_bytecode/cmp_log2_pn b/tests/10optimizer_bytecode/cmp_log2_pn new file mode 100644 index 0000000..a09600e --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log2_pn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(log2(abs(x))=-2) + \ + 2*(log2(abs(x))<-2) + \ + 4*(log2(abs(x))<=-2) + \ + 8*(log2(abs(x))>-2) + \ + 16*(log2(abs(x))>=-2) + \ + 32*(log2(abs(x))!=-2) +C=1*fp_equal(fp_log2(fp_abs(x)),-2) + \ + 2*fp_less(fp_log2(fp_abs(x)),-2) + \ + 4*fp_lessOrEq(fp_log2(fp_abs(x)),-2) + \ + 8*fp_greater(fp_log2(fp_abs(x)),-2) + \ + 16*fp_greaterOrEq(fp_log2(fp_abs(x)),-2) + \ + 32*fp_nequal(fp_log2(fp_abs(x)),-2) diff --git a/tests/10optimizer_bytecode/cmp_log2_pp b/tests/10optimizer_bytecode/cmp_log2_pp new file mode 100644 index 0000000..643dde7 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log2_pp @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(log2(abs(x))=log2(2)) + \ + 2*(log2(abs(x))<log2(2)) + \ + 4*(log2(abs(x))<=log2(2)) + \ + 8*(log2(abs(x))>log2(2)) + \ + 16*(log2(abs(x))>=log2(2)) + \ + 32*(log2(abs(x))!=log2(2)) +C=1*fp_equal(fp_log2(fp_abs(x)),fp_log2(2)) + \ + 2*fp_less(fp_log2(fp_abs(x)),fp_log2(2)) + \ + 4*fp_lessOrEq(fp_log2(fp_abs(x)),fp_log2(2)) + \ + 8*fp_greater(fp_log2(fp_abs(x)),fp_log2(2)) + \ + 16*fp_greaterOrEq(fp_log2(fp_abs(x)),fp_log2(2)) + \ + 32*fp_nequal(fp_log2(fp_abs(x)),fp_log2(2)) diff --git a/tests/10optimizer_bytecode/cmp_log_nn b/tests/10optimizer_bytecode/cmp_log_nn new file mode 100644 index 0000000..9263137 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log_nn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.5,3,0.5 +F=1*(log(x)=-2) + \ + 2*(log(x)<-2) + \ + 4*(log(x)<=-2) + \ + 8*(log(x)>-2) + \ + 16*(log(x)>=-2) + \ + 32*(log(x)!=-2) +C=1*fp_equal(fp_log(x),-2) + \ + 2*fp_less(fp_log(x),-2) + \ + 4*fp_lessOrEq(fp_log(x),-2) + \ + 8*fp_greater(fp_log(x),-2) + \ + 16*fp_greaterOrEq(fp_log(x),-2) + \ + 32*fp_nequal(fp_log(x),-2) diff --git a/tests/10optimizer_bytecode/cmp_log_np b/tests/10optimizer_bytecode/cmp_log_np new file mode 100644 index 0000000..1a83b4c --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log_np @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.5,3,0.5 +F=1*(log(x)=log(2)) + \ + 2*(log(x)<log(2)) + \ + 4*(log(x)<=log(2)) + \ + 8*(log(x)>log(2)) + \ + 16*(log(x)>=log(2)) + \ + 32*(log(x)!=log(2)) +C=1*fp_equal(fp_log(x),fp_log(2)) + \ + 2*fp_less(fp_log(x),fp_log(2)) + \ + 4*fp_lessOrEq(fp_log(x),fp_log(2)) + \ + 8*fp_greater(fp_log(x),fp_log(2)) + \ + 16*fp_greaterOrEq(fp_log(x),fp_log(2)) + \ + 32*fp_nequal(fp_log(x),fp_log(2)) diff --git a/tests/10optimizer_bytecode/cmp_log_pn b/tests/10optimizer_bytecode/cmp_log_pn new file mode 100644 index 0000000..9fb3ce0 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log_pn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(log(abs(x))=-2) + \ + 2*(log(abs(x))<-2) + \ + 4*(log(abs(x))<=-2) + \ + 8*(log(abs(x))>-2) + \ + 16*(log(abs(x))>=-2) + \ + 32*(log(abs(x))!=-2) +C=1*fp_equal(fp_log(fp_abs(x)),-2) + \ + 2*fp_less(fp_log(fp_abs(x)),-2) + \ + 4*fp_lessOrEq(fp_log(fp_abs(x)),-2) + \ + 8*fp_greater(fp_log(fp_abs(x)),-2) + \ + 16*fp_greaterOrEq(fp_log(fp_abs(x)),-2) + \ + 32*fp_nequal(fp_log(fp_abs(x)),-2) diff --git a/tests/10optimizer_bytecode/cmp_log_pp b/tests/10optimizer_bytecode/cmp_log_pp new file mode 100644 index 0000000..08d88bd --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_log_pp @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(log(abs(x))=log(2)) + \ + 2*(log(abs(x))<log(2)) + \ + 4*(log(abs(x))<=log(2)) + \ + 8*(log(abs(x))>log(2)) + \ + 16*(log(abs(x))>=log(2)) + \ + 32*(log(abs(x))!=log(2)) +C=1*fp_equal(fp_log(fp_abs(x)),fp_log(2)) + \ + 2*fp_less(fp_log(fp_abs(x)),fp_log(2)) + \ + 4*fp_lessOrEq(fp_log(fp_abs(x)),fp_log(2)) + \ + 8*fp_greater(fp_log(fp_abs(x)),fp_log(2)) + \ + 16*fp_greaterOrEq(fp_log(fp_abs(x)),fp_log(2)) + \ + 32*fp_nequal(fp_log(fp_abs(x)),fp_log(2)) diff --git a/tests/10optimizer_bytecode/cmp_mulneg b/tests/10optimizer_bytecode/cmp_mulneg new file mode 100644 index 0000000..72e2adb --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_mulneg @@ -0,0 +1,15 @@ +T=d f ld li +V=x +R=-10,10,1 +F=1*((x/2*x*5)=4) +\ + 2*((x/2*x*5)<4) +\ + 4*((x/2*x*5)<=4) +\ + 8*((x/2*x*5)>4) +\ + 16*((x/2*x*5)>=4) +\ + 32*((x/2*x*5)!=4) +C=1*fp_equal((x/2*x*5),4) +\ + 2*fp_less((x/2*x*5),4) +\ + 4*fp_lessOrEq((x/2*x*5),4) +\ + 8*fp_greater((x/2*x*5),4) +\ + 16*fp_greaterOrEq((x/2*x*5),4) +\ + 32*fp_nequal((x/2*x*5),4) diff --git a/tests/10optimizer_bytecode/cmp_mulpos b/tests/10optimizer_bytecode/cmp_mulpos new file mode 100644 index 0000000..c525153 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_mulpos @@ -0,0 +1,15 @@ +T=d f ld li +V=x +R=-10,10,1 +F=1*((x/2*x*-5)=4) +\ + 2*((x/2*x*-5)<4) +\ + 4*((x/2*x*-5)<=4) +\ + 8*((x/2*x*-5)>4) +\ + 16*((x/2*x*-5)>=4) +\ + 32*((x/2*x*-5)!=4) +C=1*fp_equal((x/2*x*-5),4) +\ + 2*fp_less((x/2*x*-5),4) +\ + 4*fp_lessOrEq((x/2*x*-5),4) +\ + 8*fp_greater((x/2*x*-5),4) +\ + 16*fp_greaterOrEq((x/2*x*-5),4) +\ + 32*fp_nequal((x/2*x*-5),4) diff --git a/tests/10optimizer_bytecode/cmp_neg b/tests/10optimizer_bytecode/cmp_neg new file mode 100644 index 0000000..790934a --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_neg @@ -0,0 +1,7 @@ +T=d f ld li +V=x +R=-10,10,1 +F=1*((-x)=4) + 2*((-x)<4) + 4*((-x)<=4) + \ + 8*((-x)>4) + 16*((-x)>=4) + 32*((-x)!=4) +C=1*fp_equal((-x),4) + 2*fp_less((-x),4) + 4*fp_lessOrEq((-x),4) + \ + 8*fp_greater((-x),4) + 16*fp_greaterOrEq((-x),4) + 32*fp_nequal((-x),4) diff --git a/tests/10optimizer_bytecode/cmp_powx_n_n b/tests/10optimizer_bytecode/cmp_powx_n_n new file mode 100644 index 0000000..369ce55 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_n_n @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-36,36,1 +F=1*(((-2.051)^x)=((-1.061)^x)) +\ + 2*(((-2.051)^x)<((-1.061)^x)) +\ + 4*(((-2.051)^x)<=((-1.061)^x)) +\ + 8*(((-2.051)^x)>((-1.061)^x)) +\ + 16*(((-2.051)^x)>=((-1.061)^x)) +\ + 32*(((-2.051)^x)!=((-1.061)^x)) +C=1*fp_equal(fp_pow(-2.051,x),fp_pow(-1.061,x)) +\ + 2*fp_less(fp_pow(-2.051,x),fp_pow(-1.061,x)) +\ + 4*fp_lessOrEq(fp_pow(-2.051,x),fp_pow(-1.061,x)) +\ + 8*fp_greater(fp_pow(-2.051,x),fp_pow(-1.061,x)) +\ + 16*fp_greaterOrEq(fp_pow(-2.051,x),fp_pow(-1.061,x)) +\ + 32*fp_nequal(fp_pow(-2.051,x),fp_pow(-1.061,x)) diff --git a/tests/10optimizer_bytecode/cmp_powx_n_p b/tests/10optimizer_bytecode/cmp_powx_n_p new file mode 100644 index 0000000..e2aaf76 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_n_p @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-36,36,1 +F=1*(((-2.051)^x)=(1.061^(x/3))) +\ + 2*(((-2.051)^x)<(1.061^(x/3))) +\ + 4*(((-2.051)^x)<=(1.061^(x/3))) +\ + 8*(((-2.051)^x)>(1.061^(x/3))) +\ + 16*(((-2.051)^x)>=(1.061^(x/3))) +\ + 32*(((-2.051)^x)!=(1.061^(x/3))) +C=1*fp_equal(fp_pow(-2.051,x),fp_pow(1.061,x/3)) +\ + 2*fp_less(fp_pow(-2.051,x),fp_pow(1.061,x/3)) +\ + 4*fp_lessOrEq(fp_pow(-2.051,x),fp_pow(1.061,x/3)) +\ + 8*fp_greater(fp_pow(-2.051,x),fp_pow(1.061,x/3)) +\ + 16*fp_greaterOrEq(fp_pow(-2.051,x),fp_pow(1.061,x/3)) +\ + 32*fp_nequal(fp_pow(-2.051,x),fp_pow(1.061,x/3)) diff --git a/tests/10optimizer_bytecode/cmp_powx_nn b/tests/10optimizer_bytecode/cmp_powx_nn new file mode 100644 index 0000000..8e6d091 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_nn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-4,4,1 +F=1*(((-2.051)^x)=-4) +\ + 2*(((-2.051)^x)<-4) +\ + 4*(((-2.051)^x)<=-4) +\ + 8*(((-2.051)^x)>-4) +\ + 16*(((-2.051)^x)>=-4) +\ + 32*(((-2.051)^x)!=-4) +C=1*fp_equal(fp_pow(-2.051,x),-4) +\ + 2*fp_less(fp_pow(-2.051,x),-4) +\ + 4*fp_lessOrEq(fp_pow(-2.051,x),-4) +\ + 8*fp_greater(fp_pow(-2.051,x),-4) +\ + 16*fp_greaterOrEq(fp_pow(-2.051,x),-4) +\ + 32*fp_nequal(fp_pow(-2.051,x),-4) diff --git a/tests/10optimizer_bytecode/cmp_powx_np b/tests/10optimizer_bytecode/cmp_powx_np new file mode 100644 index 0000000..381ef38 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_np @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-4,4,1 +F=1*(((-2.051)^x)=4) +\ + 2*(((-2.051)^x)<4) +\ + 4*(((-2.051)^x)<=4) +\ + 8*(((-2.051)^x)>4) +\ + 16*(((-2.051)^x)>=4) +\ + 32*(((-2.051)^x)!=4) +C=1*fp_equal(fp_pow(-2.051,x),4) +\ + 2*fp_less(fp_pow(-2.051,x),4) +\ + 4*fp_lessOrEq(fp_pow(-2.051,x),4) +\ + 8*fp_greater(fp_pow(-2.051,x),4) +\ + 16*fp_greaterOrEq(fp_pow(-2.051,x),4) +\ + 32*fp_nequal(fp_pow(-2.051,x),4) diff --git a/tests/10optimizer_bytecode/cmp_powx_p_n b/tests/10optimizer_bytecode/cmp_powx_p_n new file mode 100644 index 0000000..9a2662f --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_p_n @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-36,36,1 +F=1*((2.051^(x/3))=((-1.061)^x)) +\ + 2*((2.051^(x/3))<((-1.061)^x)) +\ + 4*((2.051^(x/3))<=((-1.061)^x)) +\ + 8*((2.051^(x/3))>((-1.061)^x)) +\ + 16*((2.051^(x/3))>=((-1.061)^x)) +\ + 32*((2.051^(x/3))!=((-1.061)^x)) +C=1*fp_equal(fp_pow(2.051,x/3),fp_pow(-1.061,x)) +\ + 2*fp_less(fp_pow(2.051,x/3),fp_pow(-1.061,x)) +\ + 4*fp_lessOrEq(fp_pow(2.051,x/3),fp_pow(-1.061,x)) +\ + 8*fp_greater(fp_pow(2.051,x/3),fp_pow(-1.061,x)) +\ + 16*fp_greaterOrEq(fp_pow(2.051,x/3),fp_pow(-1.061,x)) +\ + 32*fp_nequal(fp_pow(2.051,x/3),fp_pow(-1.061,x)) diff --git a/tests/10optimizer_bytecode/cmp_powx_p_p b/tests/10optimizer_bytecode/cmp_powx_p_p new file mode 100644 index 0000000..5a83a0b --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_p_p @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-36,36,1 +F=1*((2.051^(x/3))=(1.061^(x/3))) +\ + 2*((2.051^(x/3))<(1.061^(x/3))) +\ + 4*((2.051^(x/3))<=(1.061^(x/3))) +\ + 8*((2.051^(x/3))>(1.061^(x/3))) +\ + 16*((2.051^(x/3))>=(1.061^(x/3))) +\ + 32*((2.051^(x/3))!=(1.061^(x/3))) +C=1*fp_equal(fp_pow(2.051,x/3),fp_pow(1.061,x/3)) +\ + 2*fp_less(fp_pow(2.051,x/3),fp_pow(1.061,x/3)) +\ + 4*fp_lessOrEq(fp_pow(2.051,x/3),fp_pow(1.061,x/3)) +\ + 8*fp_greater(fp_pow(2.051,x/3),fp_pow(1.061,x/3)) +\ + 16*fp_greaterOrEq(fp_pow(2.051,x/3),fp_pow(1.061,x/3)) +\ + 32*fp_nequal(fp_pow(2.051,x/3),fp_pow(1.061,x/3)) diff --git a/tests/10optimizer_bytecode/cmp_powx_pn b/tests/10optimizer_bytecode/cmp_powx_pn new file mode 100644 index 0000000..1c08906 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_pn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-4,4,1 +F=1*((2.051^x)=-4) +\ + 2*((2.051^x)<-4) +\ + 4*((2.051^x)<=-4) +\ + 8*((2.051^x)>-4) +\ + 16*((2.051^x)>=-4) +\ + 32*((2.051^x)!=-4) +C=1*fp_equal(fp_pow(2.051,x),-4) +\ + 2*fp_less(fp_pow(2.051,x),-4) +\ + 4*fp_lessOrEq(fp_pow(2.051,x),-4) +\ + 8*fp_greater(fp_pow(2.051,x),-4) +\ + 16*fp_greaterOrEq(fp_pow(2.051,x),-4) +\ + 32*fp_nequal(fp_pow(2.051,x),-4) diff --git a/tests/10optimizer_bytecode/cmp_powx_pp b/tests/10optimizer_bytecode/cmp_powx_pp new file mode 100644 index 0000000..b191607 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powx_pp @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-4,4,1 +F=1*((2.051^x)=4) +\ + 2*((2.051^x)<4) +\ + 4*((2.051^x)<=4) +\ + 8*((2.051^x)>4) +\ + 16*((2.051^x)>=4) +\ + 32*((2.051^x)!=4) +C=1*fp_equal(fp_pow(2.051,x),4) +\ + 2*fp_less(fp_pow(2.051,x),4) +\ + 4*fp_lessOrEq(fp_pow(2.051,x),4) +\ + 8*fp_greater(fp_pow(2.051,x),4) +\ + 16*fp_greaterOrEq(fp_pow(2.051,x),4) +\ + 32*fp_nequal(fp_pow(2.051,x),4) diff --git a/tests/10optimizer_bytecode/cmp_powy_n_n b/tests/10optimizer_bytecode/cmp_powy_n_n new file mode 100644 index 0000000..35077a3 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_n_n @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^-5.1)=(x^-6.1)) +\ + 2*((x^-5.1)<(x^-6.1)) +\ + 4*((x^-5.1)<=(x^-6.1)) +\ + 8*((x^-5.1)>(x^-6.1)) +\ + 16*((x^-5.1)>=(x^-6.1)) +\ + 32*((x^-5.1)!=(x^-6.1)) +C=1*fp_equal(fp_pow(x,-5.1),fp_pow(x,-6.1)) +\ + 2*fp_less(fp_pow(x,-5.1),fp_pow(x,-6.1)) +\ + 4*fp_lessOrEq(fp_pow(x,-5.1),fp_pow(x,-6.1)) +\ + 8*fp_greater(fp_pow(x,-5.1),fp_pow(x,-6.1)) +\ + 16*fp_greaterOrEq(fp_pow(x,-5.1),fp_pow(x,-6.1)) +\ + 32*fp_nequal(fp_pow(x,-5.1),fp_pow(x,-6.1)) diff --git a/tests/10optimizer_bytecode/cmp_powy_n_p b/tests/10optimizer_bytecode/cmp_powy_n_p new file mode 100644 index 0000000..de1f946 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_n_p @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^-5.1)=(x^6.1)) +\ + 2*((x^-5.1)<(x^6.1)) +\ + 4*((x^-5.1)<=(x^6.1)) +\ + 8*((x^-5.1)>(x^6.1)) +\ + 16*((x^-5.1)>=(x^6.1)) +\ + 32*((x^-5.1)!=(x^6.1)) +C=1*fp_equal(fp_pow(x,-5.1),fp_pow(x,6.1)) +\ + 2*fp_less(fp_pow(x,-5.1),fp_pow(x,6.1)) +\ + 4*fp_lessOrEq(fp_pow(x,-5.1),fp_pow(x,6.1)) +\ + 8*fp_greater(fp_pow(x,-5.1),fp_pow(x,6.1)) +\ + 16*fp_greaterOrEq(fp_pow(x,-5.1),fp_pow(x,6.1)) +\ + 32*fp_nequal(fp_pow(x,-5.1),fp_pow(x,6.1)) diff --git a/tests/10optimizer_bytecode/cmp_powy_nn b/tests/10optimizer_bytecode/cmp_powy_nn new file mode 100644 index 0000000..9496964 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_nn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^-5.1)=-4) +\ + 2*((x^-5.1)<-4) +\ + 4*((x^-5.1)<=-4) +\ + 8*((x^-5.1)>-4) +\ + 16*((x^-5.1)>=-4) +\ + 32*((x^-5.1)!=-4) +C=1*fp_equal(fp_pow(x,-5.1),-4) +\ + 2*fp_less(fp_pow(x,-5.1),-4) +\ + 4*fp_lessOrEq(fp_pow(x,-5.1),-4) +\ + 8*fp_greater(fp_pow(x,-5.1),-4) +\ + 16*fp_greaterOrEq(fp_pow(x,-5.1),-4) +\ + 32*fp_nequal(fp_pow(x,-5.1),-4) diff --git a/tests/10optimizer_bytecode/cmp_powy_np b/tests/10optimizer_bytecode/cmp_powy_np new file mode 100644 index 0000000..3228697 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_np @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^-5.1)=4) +\ + 2*((x^-5.1)<4) +\ + 4*((x^-5.1)<=4) +\ + 8*((x^-5.1)>4) +\ + 16*((x^-5.1)>=4) +\ + 32*((x^-5.1)!=4) +C=1*fp_equal(fp_pow(x,-5.1),4) +\ + 2*fp_less(fp_pow(x,-5.1),4) +\ + 4*fp_lessOrEq(fp_pow(x,-5.1),4) +\ + 8*fp_greater(fp_pow(x,-5.1),4) +\ + 16*fp_greaterOrEq(fp_pow(x,-5.1),4) +\ + 32*fp_nequal(fp_pow(x,-5.1),4) diff --git a/tests/10optimizer_bytecode/cmp_powy_p_n b/tests/10optimizer_bytecode/cmp_powy_p_n new file mode 100644 index 0000000..0a26e8f --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_p_n @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^5.1)=(x^-6.1)) +\ + 2*((x^5.1)<(x^-6.1)) +\ + 4*((x^5.1)<=(x^-6.1)) +\ + 8*((x^5.1)>(x^-6.1)) +\ + 16*((x^5.1)>=(x^-6.1)) +\ + 32*((x^5.1)!=(x^-6.1)) +C=1*fp_equal(fp_pow(x,5.1),fp_pow(x,-6.1)) +\ + 2*fp_less(fp_pow(x,5.1),fp_pow(x,-6.1)) +\ + 4*fp_lessOrEq(fp_pow(x,5.1),fp_pow(x,-6.1)) +\ + 8*fp_greater(fp_pow(x,5.1),fp_pow(x,-6.1)) +\ + 16*fp_greaterOrEq(fp_pow(x,5.1),fp_pow(x,-6.1)) +\ + 32*fp_nequal(fp_pow(x,5.1),fp_pow(x,-6.1)) diff --git a/tests/10optimizer_bytecode/cmp_powy_p_p b/tests/10optimizer_bytecode/cmp_powy_p_p new file mode 100644 index 0000000..3ff2fe6 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_p_p @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^5.1)=(x^6.1)) +\ + 2*((x^5.1)<(x^6.1)) +\ + 4*((x^5.1)<=(x^6.1)) +\ + 8*((x^5.1)>(x^6.1)) +\ + 16*((x^5.1)>=(x^6.1)) +\ + 32*((x^5.1)!=(x^6.1)) +C=1*fp_equal(fp_pow(x,5.1),fp_pow(x,6.1)) +\ + 2*fp_less(fp_pow(x,5.1),fp_pow(x,6.1)) +\ + 4*fp_lessOrEq(fp_pow(x,5.1),fp_pow(x,6.1)) +\ + 8*fp_greater(fp_pow(x,5.1),fp_pow(x,6.1)) +\ + 16*fp_greaterOrEq(fp_pow(x,5.1),fp_pow(x,6.1)) +\ + 32*fp_nequal(fp_pow(x,5.1),fp_pow(x,6.1)) diff --git a/tests/10optimizer_bytecode/cmp_powy_pn b/tests/10optimizer_bytecode/cmp_powy_pn new file mode 100644 index 0000000..1c6e4db --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_pn @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^5.1)=-4) +\ + 2*((x^5.1)<-4) +\ + 4*((x^5.1)<=-4) +\ + 8*((x^5.1)>-4) +\ + 16*((x^5.1)>=-4) +\ + 32*((x^5.1)!=-4) +C=1*fp_equal(fp_pow(x,5.1),-4) +\ + 2*fp_less(fp_pow(x,5.1),-4) +\ + 4*fp_lessOrEq(fp_pow(x,5.1),-4) +\ + 8*fp_greater(fp_pow(x,5.1),-4) +\ + 16*fp_greaterOrEq(fp_pow(x,5.1),-4) +\ + 32*fp_nequal(fp_pow(x,5.1),-4) diff --git a/tests/10optimizer_bytecode/cmp_powy_pp b/tests/10optimizer_bytecode/cmp_powy_pp new file mode 100644 index 0000000..7d809da --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_powy_pp @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=0.25,3,0.25 +F=1*((x^5.1)=4) +\ + 2*((x^5.1)<4) +\ + 4*((x^5.1)<=4) +\ + 8*((x^5.1)>4) +\ + 16*((x^5.1)>=4) +\ + 32*((x^5.1)!=4) +C=1*fp_equal(fp_pow(x,5.1),4) +\ + 2*fp_less(fp_pow(x,5.1),4) +\ + 4*fp_lessOrEq(fp_pow(x,5.1),4) +\ + 8*fp_greater(fp_pow(x,5.1),4) +\ + 16*fp_greaterOrEq(fp_pow(x,5.1),4) +\ + 32*fp_nequal(fp_pow(x,5.1),4) diff --git a/tests/10optimizer_bytecode/cmp_sinh b/tests/10optimizer_bytecode/cmp_sinh new file mode 100644 index 0000000..16531b3 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_sinh @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-3,3,0.5 +F=1*(sinh(x)=sinh(2)) + \ + 2*(sinh(x)<sinh(2)) + \ + 4*(sinh(x)<=sinh(2)) + \ + 8*(sinh(x)>sinh(2)) + \ + 16*(sinh(x)>=sinh(2)) + \ + 32*(sinh(x)!=sinh(2)) +C=1*fp_equal(fp_sinh(x),fp_sinh(2)) + \ + 2*fp_less(fp_sinh(x),fp_sinh(2)) + \ + 4*fp_lessOrEq(fp_sinh(x),fp_sinh(2)) + \ + 8*fp_greater(fp_sinh(x),fp_sinh(2)) + \ + 16*fp_greaterOrEq(fp_sinh(x),fp_sinh(2)) + \ + 32*fp_nequal(fp_sinh(x),fp_sinh(2)) diff --git a/tests/10optimizer_bytecode/cmp_sqr b/tests/10optimizer_bytecode/cmp_sqr new file mode 100644 index 0000000..91cf41c --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_sqr @@ -0,0 +1,7 @@ +T=d f ld li +V=x +R=-10,10,1 +F=1*((x*x)=16) + 2*((x*x)<16) + 4*((x*x)<=16) + \ + 8*((x*x)>16) + 16*((x*x)>=16) + 32*((x*x)!=16) +C=1*fp_equal((x*x),16) + 2*fp_less((x*x),16) + 4*fp_lessOrEq((x*x),16) + \ + 8*fp_greater((x*x),16) + 16*fp_greaterOrEq((x*x),16) + 32*fp_nequal((x*x),16) diff --git a/tests/10optimizer_bytecode/cmp_sqr_neg b/tests/10optimizer_bytecode/cmp_sqr_neg new file mode 100644 index 0000000..680b0ac --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_sqr_neg @@ -0,0 +1,7 @@ +T=d f ld li +V=x +R=-10,10,1 +F=1*((x*x)=-16) + 2*((x*x)<-16) + 4*((x*x)<=-16) + \ + 8*((x*x)>-16) + -16*((x*x)>=-16) + 32*((x*x)!=-16) +C=1*fp_equal((x*x),-16) + 2*fp_less((x*x),-16) + 4*fp_lessOrEq((x*x),-16) + \ + 8*fp_greater((x*x),-16) + -16*fp_greaterOrEq((x*x),-16) + 32*fp_nequal((x*x),-16) diff --git a/tests/10optimizer_bytecode/cmp_tanh b/tests/10optimizer_bytecode/cmp_tanh new file mode 100644 index 0000000..6a6fcac --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_tanh @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-4,4,0.25 +F=1*(tanh(x)=tanh(0.75)) + \ + 2*(tanh(x)<tanh(0.75)) + \ + 4*(tanh(x)<=tanh(0.75)) + \ + 8*(tanh(x)>tanh(0.75)) + \ + 16*(tanh(x)>=tanh(0.75)) + \ + 32*(tanh(x)!=tanh(0.75)) +C=1*fp_equal(fp_tanh(x),fp_tanh(0.75)) + \ + 2*fp_less(fp_tanh(x),fp_tanh(0.75)) + \ + 4*fp_lessOrEq(fp_tanh(x),fp_tanh(0.75)) + \ + 8*fp_greater(fp_tanh(x),fp_tanh(0.75)) + \ + 16*fp_greaterOrEq(fp_tanh(x),fp_tanh(0.75)) + \ + 32*fp_nequal(fp_tanh(x),fp_tanh(0.75)) diff --git a/tests/10optimizer_bytecode/cmp_tanh_outrange b/tests/10optimizer_bytecode/cmp_tanh_outrange new file mode 100644 index 0000000..08061e1 --- /dev/null +++ b/tests/10optimizer_bytecode/cmp_tanh_outrange @@ -0,0 +1,15 @@ +T=d f ld +V=x +R=-4,4,0.25 +F=1*(tanh(x)=2) + \ + 2*(tanh(x)<2) + \ + 4*(tanh(x)<=2) + \ + 8*(tanh(x)>2) + \ + 16*(tanh(x)>=2) + \ + 32*(tanh(x)!=2) +C=1*fp_equal(fp_tanh(x),2) + \ + 2*fp_less(fp_tanh(x),2) + \ + 4*fp_lessOrEq(fp_tanh(x),2) + \ + 8*fp_greater(fp_tanh(x),2) + \ + 16*fp_greaterOrEq(fp_tanh(x),2) + \ + 32*fp_nequal(fp_tanh(x),2) diff --git a/tests/10optimizer_bytecode/cmpeq b/tests/10optimizer_bytecode/cmpeq new file mode 100644 index 0000000..c2f5a88 --- /dev/null +++ b/tests/10optimizer_bytecode/cmpeq @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5=3)+x+(4=4) +C=fp_equal(5,3)+x+fp_equal(4,4) diff --git a/tests/10optimizer_bytecode/cmpge b/tests/10optimizer_bytecode/cmpge new file mode 100644 index 0000000..d8c021e --- /dev/null +++ b/tests/10optimizer_bytecode/cmpge @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5>=3)+x+(4>=8) +C=fp_lessOrEq(3,5)+x+fp_lessOrEq(8,4) diff --git a/tests/10optimizer_bytecode/cmpgt b/tests/10optimizer_bytecode/cmpgt new file mode 100644 index 0000000..73fbb0f --- /dev/null +++ b/tests/10optimizer_bytecode/cmpgt @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5>3)+x+(4>8) +C=fp_less(3,5)+x+fp_less(8,4) diff --git a/tests/10optimizer_bytecode/cmple b/tests/10optimizer_bytecode/cmple new file mode 100644 index 0000000..17fb34b --- /dev/null +++ b/tests/10optimizer_bytecode/cmple @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5<3)+x+(4<8) +C=fp_lessOrEq(5,3)+x+fp_lessOrEq(4,8) diff --git a/tests/10optimizer_bytecode/cmplt b/tests/10optimizer_bytecode/cmplt new file mode 100644 index 0000000..5257c84 --- /dev/null +++ b/tests/10optimizer_bytecode/cmplt @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5<3)+x +C=fp_less(5,3)+x diff --git a/tests/10optimizer_bytecode/cmpne b/tests/10optimizer_bytecode/cmpne new file mode 100644 index 0000000..9c3d907 --- /dev/null +++ b/tests/10optimizer_bytecode/cmpne @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5!=3)+x+(4!=4) +C=fp_nequal(5,3)+x+fp_nequal(4,4) diff --git a/tests/10optimizer_bytecode/cos b/tests/10optimizer_bytecode/cos new file mode 100644 index 0000000..97ad037 --- /dev/null +++ b/tests/10optimizer_bytecode/cos @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=cos(1.1)+x +C=cos(1.1)+x diff --git a/tests/10optimizer_bytecode/cos_deg b/tests/10optimizer_bytecode/cos_deg new file mode 100644 index 0000000..833a6db --- /dev/null +++ b/tests/10optimizer_bytecode/cos_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=cos(1.1)+x +C=cos(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/cosf b/tests/10optimizer_bytecode/cosf new file mode 100644 index 0000000..7f6b743 --- /dev/null +++ b/tests/10optimizer_bytecode/cosf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=cos(1.1)+x +C=cosf(1.1)+x diff --git a/tests/10optimizer_bytecode/cosf_deg b/tests/10optimizer_bytecode/cosf_deg new file mode 100644 index 0000000..c9d2241 --- /dev/null +++ b/tests/10optimizer_bytecode/cosf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=cos(1.1)+x +C=cosf(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/cosh b/tests/10optimizer_bytecode/cosh new file mode 100644 index 0000000..5c83211 --- /dev/null +++ b/tests/10optimizer_bytecode/cosh @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=cosh(1.1)+x +C=cosh(1.1)+x diff --git a/tests/10optimizer_bytecode/cosh_deg b/tests/10optimizer_bytecode/cosh_deg new file mode 100644 index 0000000..57b8f27 --- /dev/null +++ b/tests/10optimizer_bytecode/cosh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=cosh(1.1)+x +C=cosh(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/coshf b/tests/10optimizer_bytecode/coshf new file mode 100644 index 0000000..41789ae --- /dev/null +++ b/tests/10optimizer_bytecode/coshf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=cosh(1.1)+x +C=coshf(1.1)+x diff --git a/tests/10optimizer_bytecode/coshf_deg b/tests/10optimizer_bytecode/coshf_deg new file mode 100644 index 0000000..83dfc89 --- /dev/null +++ b/tests/10optimizer_bytecode/coshf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=cosh(1.1)+x +C=coshf(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/coshl b/tests/10optimizer_bytecode/coshl new file mode 100644 index 0000000..23f3f8d --- /dev/null +++ b/tests/10optimizer_bytecode/coshl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=cosh(1.1)+x +C=coshl(1.1)+x diff --git a/tests/10optimizer_bytecode/coshl_deg b/tests/10optimizer_bytecode/coshl_deg new file mode 100644 index 0000000..e4fb524 --- /dev/null +++ b/tests/10optimizer_bytecode/coshl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=cosh(1.1)+x +C=coshl(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/coshm b/tests/10optimizer_bytecode/coshm new file mode 100644 index 0000000..0c301c6 --- /dev/null +++ b/tests/10optimizer_bytecode/coshm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=cosh(1.1)+x +C=MpfrFloat::cosh(1.1)+x diff --git a/tests/10optimizer_bytecode/coshm_deg b/tests/10optimizer_bytecode/coshm_deg new file mode 100644 index 0000000..0da634f --- /dev/null +++ b/tests/10optimizer_bytecode/coshm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=cosh(1.1)+x +C=MpfrFloat::cosh(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/cosl b/tests/10optimizer_bytecode/cosl new file mode 100644 index 0000000..6ded7de --- /dev/null +++ b/tests/10optimizer_bytecode/cosl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=cos(1.1)+x +C=cosl(1.1)+x diff --git a/tests/10optimizer_bytecode/cosl_deg b/tests/10optimizer_bytecode/cosl_deg new file mode 100644 index 0000000..8ea0d3b --- /dev/null +++ b/tests/10optimizer_bytecode/cosl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=cos(1.1)+x +C=cosl(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/cosm b/tests/10optimizer_bytecode/cosm new file mode 100644 index 0000000..909c221 --- /dev/null +++ b/tests/10optimizer_bytecode/cosm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=cos(1.1)+x +C=MpfrFloat::cos(1.1)+x diff --git a/tests/10optimizer_bytecode/cosm_deg b/tests/10optimizer_bytecode/cosm_deg new file mode 100644 index 0000000..fb3490f --- /dev/null +++ b/tests/10optimizer_bytecode/cosm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=cos(1.1)+x +C=MpfrFloat::cos(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/deg b/tests/10optimizer_bytecode/deg new file mode 100644 index 0000000..66b2867 --- /dev/null +++ b/tests/10optimizer_bytecode/deg @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-10,10,0.8 +F=(180/pi)*y + x*(180/pi) + (y*(180/pi))*4 +C=r2d(y) + r2d(x) + r2d(y)*4 diff --git a/tests/10optimizer_bytecode/degxmul b/tests/10optimizer_bytecode/degxmul new file mode 100644 index 0000000..1e10622 --- /dev/null +++ b/tests/10optimizer_bytecode/degxmul @@ -0,0 +1,6 @@ +DEG=1 +T=d f ld mf +V=x +R=-1,1,0.5 +F=acos(x)*2 +C=r2d(fp_acos(x))*2 diff --git a/tests/10optimizer_bytecode/div b/tests/10optimizer_bytecode/div new file mode 100644 index 0000000..f4c9df0 --- /dev/null +++ b/tests/10optimizer_bytecode/div @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5/4)+x +C=(5/4)+x diff --git a/tests/10optimizer_bytecode/div1 b/tests/10optimizer_bytecode/div1 new file mode 100644 index 0000000..fe1e402 --- /dev/null +++ b/tests/10optimizer_bytecode/div1 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=x/1+x +C=x/1+x diff --git a/tests/10optimizer_bytecode/divxx b/tests/10optimizer_bytecode/divxx new file mode 100644 index 0000000..56f9350 --- /dev/null +++ b/tests/10optimizer_bytecode/divxx @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=x+x/x+x +C=x+x/x+x diff --git a/tests/10optimizer_bytecode/dupaddmul7 b/tests/10optimizer_bytecode/dupaddmul7 new file mode 100644 index 0000000..eaa6892 --- /dev/null +++ b/tests/10optimizer_bytecode/dupaddmul7 @@ -0,0 +1,7 @@ +# cDup cAdd x cMul + +T=d f ld mf li gi +V=x +R=-3,3,1 +F=(x+x)*7 +C=x*14 diff --git a/tests/10optimizer_bytecode/dupaddmulh b/tests/10optimizer_bytecode/dupaddmulh new file mode 100644 index 0000000..3198446 --- /dev/null +++ b/tests/10optimizer_bytecode/dupaddmulh @@ -0,0 +1,7 @@ +# cDup [x+x==Value_t(1)] cAdd x cMul + +T=d f ld mf +V=x +R=-3,3,1 +F=(x+x)*0.5 +C=x diff --git a/tests/10optimizer_bytecode/dupaddmulmul7 b/tests/10optimizer_bytecode/dupaddmulmul7 new file mode 100644 index 0000000..5eb9f3b --- /dev/null +++ b/tests/10optimizer_bytecode/dupaddmulmul7 @@ -0,0 +1,7 @@ +# cDup cAdd cMul x cMul + +T=d f ld mf +V=x,y +R=-3,3,1 +F=y*(x+x)*7 +C=y*x*14 diff --git a/tests/10optimizer_bytecode/dupaddmulmulh b/tests/10optimizer_bytecode/dupaddmulmulh new file mode 100644 index 0000000..8cfefbd --- /dev/null +++ b/tests/10optimizer_bytecode/dupaddmulmulh @@ -0,0 +1,7 @@ +# cDup [x+x==Value_t(1)] cAdd cMul x cMul + +T=d f ld mf +V=x,y +R=-3,3,1 +F=y*(x+x)*0.5 +C=y*x diff --git a/tests/10optimizer_bytecode/dupminmax b/tests/10optimizer_bytecode/dupminmax new file mode 100644 index 0000000..809be8a --- /dev/null +++ b/tests/10optimizer_bytecode/dupminmax @@ -0,0 +1,7 @@ +# cDup cMin -> +# cDup cMax -> +T=d f ld li gi +V=x +R=-10,10,1 +F=sub(min(x,x), max(x,x)) +C=userDefFuncSub({fp_min(x,x), fp_max(x,x)}) diff --git a/tests/10optimizer_bytecode/dupminmax2 b/tests/10optimizer_bytecode/dupminmax2 new file mode 100644 index 0000000..d18ae47 --- /dev/null +++ b/tests/10optimizer_bytecode/dupminmax2 @@ -0,0 +1,7 @@ +# x cDup x cMin -> x cDup +# x cDup x cMax -> x cDup +T=d f ld li gi +V=x +R=-10,10,1 +F=sub(x+min(x,x), x+max(x,x)) +C=userDefFuncSub({x+fp_min(x,x), x+fp_max(x,x)}) diff --git a/tests/10optimizer_bytecode/dupminmax3 b/tests/10optimizer_bytecode/dupminmax3 new file mode 100644 index 0000000..013780b --- /dev/null +++ b/tests/10optimizer_bytecode/dupminmax3 @@ -0,0 +1,6 @@ +# x cMin x cMin -> x cMin +T=d f ld li gi +V=x,y +R=-2,2,1 +F=sub(min(min(y,x),x), max(max(y,x),x)) +C=userDefFuncSub({fp_min(y,x), fp_max(y,x)}) diff --git a/tests/10optimizer_bytecode/dupxmuladd b/tests/10optimizer_bytecode/dupxmuladd new file mode 100644 index 0000000..ca88d7f --- /dev/null +++ b/tests/10optimizer_bytecode/dupxmuladd @@ -0,0 +1,5 @@ +T=d f ld li gi mf +V=x +R=-10,10,1 +F=x+(x*4) +C=x*5 diff --git a/tests/10optimizer_bytecode/dupxpowmul b/tests/10optimizer_bytecode/dupxpowmul new file mode 100644 index 0000000..ba8bf8c --- /dev/null +++ b/tests/10optimizer_bytecode/dupxpowmul @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-10,10,1 +F=x*(x^3) +C=fp_pow(x,4) diff --git a/tests/10optimizer_bytecode/eq0 b/tests/10optimizer_bytecode/eq0 new file mode 100644 index 0000000..943fb87 --- /dev/null +++ b/tests/10optimizer_bytecode/eq0 @@ -0,0 +1,6 @@ +T=d f ld li +V=x +R=0,1,1 +F=(x=0) + (0=x) +C=fp_equal(x,0) + fp_equal(0,x) + diff --git a/tests/10optimizer_bytecode/eq1 b/tests/10optimizer_bytecode/eq1 new file mode 100644 index 0000000..035d5a0 --- /dev/null +++ b/tests/10optimizer_bytecode/eq1 @@ -0,0 +1,6 @@ +T=d f ld li +V=x +R=0,1,1 +F=(!x=1) +C=fp_equal(fp_not(x),1) + diff --git a/tests/10optimizer_bytecode/exp b/tests/10optimizer_bytecode/exp new file mode 100644 index 0000000..11dd5ea --- /dev/null +++ b/tests/10optimizer_bytecode/exp @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=exp(1.1)+x +C=exp(1.1)+x diff --git a/tests/10optimizer_bytecode/exp2 b/tests/10optimizer_bytecode/exp2 new file mode 100644 index 0000000..c5af366 --- /dev/null +++ b/tests/10optimizer_bytecode/exp2 @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=exp2(1.1)+x +C=exp(1.1*0.693147180559945309417232121458176568075500134)+x diff --git a/tests/10optimizer_bytecode/exp2div b/tests/10optimizer_bytecode/exp2div new file mode 100644 index 0000000..0ec271c --- /dev/null +++ b/tests/10optimizer_bytecode/exp2div @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-3,3,2 +F=x/exp2(y) +C=x/fp_exp2(y) diff --git a/tests/10optimizer_bytecode/exp2f b/tests/10optimizer_bytecode/exp2f new file mode 100644 index 0000000..64520e8 --- /dev/null +++ b/tests/10optimizer_bytecode/exp2f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=exp2(1.1)+x +C=expf(1.1*0.693147180559945309417232121458176568075500134)+x diff --git a/tests/10optimizer_bytecode/exp2l b/tests/10optimizer_bytecode/exp2l new file mode 100644 index 0000000..d474447 --- /dev/null +++ b/tests/10optimizer_bytecode/exp2l @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=exp2(1.1)+x +C=expl(1.1*0.693147180559945309417232121458176568075500134)+x diff --git a/tests/10optimizer_bytecode/exp2log2 b/tests/10optimizer_bytecode/exp2log2 new file mode 100644 index 0000000..235cab8 --- /dev/null +++ b/tests/10optimizer_bytecode/exp2log2 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-3,3,0.1 +F=log2(exp2(x)) +C=fp_log2(fp_exp2(x)) diff --git a/tests/10optimizer_bytecode/exp2m b/tests/10optimizer_bytecode/exp2m new file mode 100644 index 0000000..9a6e382 --- /dev/null +++ b/tests/10optimizer_bytecode/exp2m @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=exp2(1.1)+x +C=MpfrFloat::exp2(1.1)+x diff --git a/tests/10optimizer_bytecode/exp2xpow b/tests/10optimizer_bytecode/exp2xpow new file mode 100644 index 0000000..eaa05f6 --- /dev/null +++ b/tests/10optimizer_bytecode/exp2xpow @@ -0,0 +1,6 @@ +# cExp2 x [IsIntegerConst(x)] cPow -> [x] cMul cExp +T=d +V=x +R=-.1,.1,0.01 +F=exp2(x)^1506 +C=fp_pow(fp_exp2(x),1506) diff --git a/tests/10optimizer_bytecode/expdiv b/tests/10optimizer_bytecode/expdiv new file mode 100644 index 0000000..82cc12b --- /dev/null +++ b/tests/10optimizer_bytecode/expdiv @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-3,3,2 +F=x/exp(y) +C=x/fp_exp(y) diff --git a/tests/10optimizer_bytecode/expf b/tests/10optimizer_bytecode/expf new file mode 100644 index 0000000..b2a81ce --- /dev/null +++ b/tests/10optimizer_bytecode/expf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=exp(1.1)+x +C=expf(1.1)+x diff --git a/tests/10optimizer_bytecode/expl b/tests/10optimizer_bytecode/expl new file mode 100644 index 0000000..1d465e9 --- /dev/null +++ b/tests/10optimizer_bytecode/expl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=exp(1.1)+x +C=expl(1.1)+x diff --git a/tests/10optimizer_bytecode/explog b/tests/10optimizer_bytecode/explog new file mode 100644 index 0000000..a32cc71 --- /dev/null +++ b/tests/10optimizer_bytecode/explog @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-3,3,0.1 +F=log(exp(x)) +C=fp_log(fp_exp(x)) diff --git a/tests/10optimizer_bytecode/explog10 b/tests/10optimizer_bytecode/explog10 new file mode 100644 index 0000000..4f2522d --- /dev/null +++ b/tests/10optimizer_bytecode/explog10 @@ -0,0 +1,7 @@ +# log10(exp(x)) = log(exp(x)) / log(10) = x / log(10) + +T=d f ld mf +V=x +R=-3,3,0.1 +F=log10(exp(x)) +C=x/fp_const_log10<Value_t>() diff --git a/tests/10optimizer_bytecode/explog2 b/tests/10optimizer_bytecode/explog2 new file mode 100644 index 0000000..8f25bda --- /dev/null +++ b/tests/10optimizer_bytecode/explog2 @@ -0,0 +1,7 @@ +# log2(exp(x)) = log(exp(x)) / log(2) = x / log(2) + +T=d f ld mf +V=x +R=-3,3,0.1 +F=log2(exp(x)) +C=x/fp_const_log2<Value_t>() diff --git a/tests/10optimizer_bytecode/expm b/tests/10optimizer_bytecode/expm new file mode 100644 index 0000000..8d96fb7 --- /dev/null +++ b/tests/10optimizer_bytecode/expm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=exp(1.1)+x +C=MpfrFloat::exp(1.1)+x diff --git a/tests/10optimizer_bytecode/expxpow b/tests/10optimizer_bytecode/expxpow new file mode 100644 index 0000000..53855cc --- /dev/null +++ b/tests/10optimizer_bytecode/expxpow @@ -0,0 +1,6 @@ +# cExp x [IsIntegerConst(x)] cPow -> [x] cMul cExp +T=d +V=x +R=-.1,.1,0.01 +F=exp(x)^1506 +C=fp_pow(fp_exp(x),1506) diff --git a/tests/10optimizer_bytecode/floor b/tests/10optimizer_bytecode/floor new file mode 100644 index 0000000..6c82a18 --- /dev/null +++ b/tests/10optimizer_bytecode/floor @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=floor(1.1)+x +C=floor(1.1)+x diff --git a/tests/10optimizer_bytecode/floorf b/tests/10optimizer_bytecode/floorf new file mode 100644 index 0000000..d93a997 --- /dev/null +++ b/tests/10optimizer_bytecode/floorf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=floor(1.1)+x +C=floorf(1.1)+x diff --git a/tests/10optimizer_bytecode/floorl b/tests/10optimizer_bytecode/floorl new file mode 100644 index 0000000..1c5f978 --- /dev/null +++ b/tests/10optimizer_bytecode/floorl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=floor(1.1)+x +C=floorl(1.1)+x diff --git a/tests/10optimizer_bytecode/floorm b/tests/10optimizer_bytecode/floorm new file mode 100644 index 0000000..534e9c8 --- /dev/null +++ b/tests/10optimizer_bytecode/floorm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=floor(1.1)+x +C=MpfrFloat::floor(1.1)+x diff --git a/tests/10optimizer_bytecode/floorneg b/tests/10optimizer_bytecode/floorneg new file mode 100644 index 0000000..8f99333 --- /dev/null +++ b/tests/10optimizer_bytecode/floorneg @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=floor(-x) +C=fp_floor(-x) diff --git a/tests/10optimizer_bytecode/ge0_abs b/tests/10optimizer_bytecode/ge0_abs new file mode 100644 index 0000000..8ff0618 --- /dev/null +++ b/tests/10optimizer_bytecode/ge0_abs @@ -0,0 +1,11 @@ +T=d f ld li +V=x +R=-1,1,1 +F=(abs(x) >= 0) + \ + 2*(0 <= abs(x)) + \ + 4*(abs(x) <= 0) + \ + 8*(0 >= abs(x)) +C=fp_greaterOrEq(fp_abs(x), 0) + \ + 2*fp_lessOrEq(0, fp_abs(x)) + \ + 4*fp_lessOrEq(fp_abs(x), 0) + \ + 8*fp_greaterOrEq(0, fp_abs(x)) diff --git a/tests/10optimizer_bytecode/ge0_neg b/tests/10optimizer_bytecode/ge0_neg new file mode 100644 index 0000000..6bb1644 --- /dev/null +++ b/tests/10optimizer_bytecode/ge0_neg @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(sin(x) >= 0) + \ + 2*(0 <= sin(x)) + \ + 4*(sin(x) <= 0) + \ + 8*(0 >= sin(x)) +C=fp_greaterOrEq(fp_sin(x), 0) + \ + 2*fp_lessOrEq(0, fp_sin(x)) + \ + 4*fp_lessOrEq(fp_sin(x), 0) + \ + 8*fp_greaterOrEq(0, fp_sin(x)) diff --git a/tests/10optimizer_bytecode/ge0_pos b/tests/10optimizer_bytecode/ge0_pos new file mode 100644 index 0000000..f24679b --- /dev/null +++ b/tests/10optimizer_bytecode/ge0_pos @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(acos(x) >= 0) + \ + 2*(0 <= acos(x)) + \ + 4*(acos(x) <= 0) + \ + 8*(0 >= acos(x)) +C=fp_greaterOrEq(fp_acos(x), 0) + \ + 2*fp_lessOrEq(0, fp_acos(x)) + \ + 4*fp_lessOrEq(fp_acos(x), 0) + \ + 8*fp_greaterOrEq(0, fp_acos(x)) diff --git a/tests/10optimizer_bytecode/ge1_abs b/tests/10optimizer_bytecode/ge1_abs new file mode 100644 index 0000000..be20358 --- /dev/null +++ b/tests/10optimizer_bytecode/ge1_abs @@ -0,0 +1,11 @@ +T=d f ld li +V=x +R=-1,1,1 +F=(abs(x) >= 1) + \ + 2*(1 <= abs(x)) + \ + 4*(abs(x) <= 1) + \ + 8*(1 >= abs(x)) +C=fp_greaterOrEq(fp_abs(x), 1) + \ + 2*fp_lessOrEq(1, fp_abs(x)) + \ + 4*fp_lessOrEq(fp_abs(x), 1) + \ + 8*fp_greaterOrEq(1, fp_abs(x)) diff --git a/tests/10optimizer_bytecode/ge1_neg b/tests/10optimizer_bytecode/ge1_neg new file mode 100644 index 0000000..0cef2d4 --- /dev/null +++ b/tests/10optimizer_bytecode/ge1_neg @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(sin(x) >= 1) + \ + 2*(1 <= sin(x)) + \ + 4*(sin(x) <= 1) + \ + 8*(1 >= sin(x)) +C=fp_greaterOrEq(fp_sin(x), 1) + \ + 2*fp_lessOrEq(1, fp_sin(x)) + \ + 4*fp_lessOrEq(fp_sin(x), 1) + \ + 8*fp_greaterOrEq(1, fp_sin(x)) diff --git a/tests/10optimizer_bytecode/ge1_pos b/tests/10optimizer_bytecode/ge1_pos new file mode 100644 index 0000000..7e8b32b --- /dev/null +++ b/tests/10optimizer_bytecode/ge1_pos @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(acos(x) >= 1) + \ + 2*(1 <= acos(x)) + \ + 4*(acos(x) <= 1) + \ + 8*(1 >= acos(x)) +C=fp_greaterOrEq(fp_acos(x), 1) + \ + 2*fp_lessOrEq(1, fp_acos(x)) + \ + 4*fp_lessOrEq(fp_acos(x), 1) + \ + 8*fp_greaterOrEq(1, fp_acos(x)) diff --git a/tests/10optimizer_bytecode/gehalf b/tests/10optimizer_bytecode/gehalf new file mode 100644 index 0000000..45177a5 --- /dev/null +++ b/tests/10optimizer_bytecode/gehalf @@ -0,0 +1,5 @@ +T=d f +V=x +R=-1,1,0.25 +F=x>=0.5 +C=fp_greaterOrEq(x, 0.5) diff --git a/tests/10optimizer_bytecode/gt0_abs b/tests/10optimizer_bytecode/gt0_abs new file mode 100644 index 0000000..dccab23 --- /dev/null +++ b/tests/10optimizer_bytecode/gt0_abs @@ -0,0 +1,11 @@ +T=d f ld li +V=x +R=-1,1,1 +F=(abs(x) > 0) + \ + 2*(0 < abs(x)) + \ + 4*(abs(x) < 0) + \ + 8*(0 > abs(x)) +C=fp_greater(fp_abs(x), 0) + \ + 2*fp_less(0, fp_abs(x)) + \ + 4*fp_less(fp_abs(x), 0) + \ + 8*fp_greater(0, fp_abs(x)) diff --git a/tests/10optimizer_bytecode/gt0_neg b/tests/10optimizer_bytecode/gt0_neg new file mode 100644 index 0000000..9ea34e3 --- /dev/null +++ b/tests/10optimizer_bytecode/gt0_neg @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(sin(x) > 0) + \ + 2*(0 < sin(x)) + \ + 4*(sin(x) < 0) + \ + 8*(0 > sin(x)) +C=fp_greater(fp_sin(x), 0) + \ + 2*fp_less(0, fp_sin(x)) + \ + 4*fp_less(fp_sin(x), 0) + \ + 8*fp_greater(0, fp_sin(x)) diff --git a/tests/10optimizer_bytecode/gt0_pos b/tests/10optimizer_bytecode/gt0_pos new file mode 100644 index 0000000..b2c2423 --- /dev/null +++ b/tests/10optimizer_bytecode/gt0_pos @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(acos(x) > 0) + \ + 2*(0 < acos(x)) + \ + 4*(acos(x) < 0) + \ + 8*(0 > acos(x)) +C=fp_greater(fp_acos(x), 0) + \ + 2*fp_less(0, fp_acos(x)) + \ + 4*fp_less(fp_acos(x), 0) + \ + 8*fp_greater(0, fp_acos(x)) diff --git a/tests/10optimizer_bytecode/gt1_abs b/tests/10optimizer_bytecode/gt1_abs new file mode 100644 index 0000000..f412eab --- /dev/null +++ b/tests/10optimizer_bytecode/gt1_abs @@ -0,0 +1,11 @@ +T=d f ld li +V=x +R=-1,1,1 +F=(abs(x) > 1) + \ + 2*(1 < abs(x)) + \ + 4*(abs(x) < 1) + \ + 8*(1 > abs(x)) +C=fp_greater(fp_abs(x), 1) + \ + 2*fp_less(1, fp_abs(x)) + \ + 4*fp_less(fp_abs(x), 1) + \ + 8*fp_greater(1, fp_abs(x)) diff --git a/tests/10optimizer_bytecode/gt1_neg b/tests/10optimizer_bytecode/gt1_neg new file mode 100644 index 0000000..70f9a76 --- /dev/null +++ b/tests/10optimizer_bytecode/gt1_neg @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(sin(x) > 1) + \ + 2*(1 < sin(x)) + \ + 4*(sin(x) < 1) + \ + 8*(1 > sin(x)) +C=fp_greater(fp_sin(x), 1) + \ + 2*fp_less(1, fp_sin(x)) + \ + 4*fp_less(fp_sin(x), 1) + \ + 8*fp_greater(1, fp_sin(x)) diff --git a/tests/10optimizer_bytecode/gt1_pos b/tests/10optimizer_bytecode/gt1_pos new file mode 100644 index 0000000..bcf95cf --- /dev/null +++ b/tests/10optimizer_bytecode/gt1_pos @@ -0,0 +1,11 @@ +T=d f ld +V=x +R=-1,1,0.25 +F=(acos(x) > 1) + \ + 2*(1 < acos(x)) + \ + 4*(acos(x) < 1) + \ + 8*(1 > acos(x)) +C=fp_greater(fp_acos(x), 1) + \ + 2*fp_less(1, fp_acos(x)) + \ + 4*fp_less(fp_acos(x), 1) + \ + 8*fp_greater(1, fp_acos(x)) diff --git a/tests/10optimizer_bytecode/gtminushalf b/tests/10optimizer_bytecode/gtminushalf new file mode 100644 index 0000000..64a7611 --- /dev/null +++ b/tests/10optimizer_bytecode/gtminushalf @@ -0,0 +1,5 @@ +T=d f +V=x +R=-1,1,0.25 +F=x>-0.5 +C=fp_greater(x, -0.5) diff --git a/tests/10optimizer_bytecode/hypot b/tests/10optimizer_bytecode/hypot new file mode 100644 index 0000000..801ecf9 --- /dev/null +++ b/tests/10optimizer_bytecode/hypot @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=hypot(5,4)+x +C=sqrt(5*5+4*4)+x diff --git a/tests/10optimizer_bytecode/hypotf b/tests/10optimizer_bytecode/hypotf new file mode 100644 index 0000000..0e55778 --- /dev/null +++ b/tests/10optimizer_bytecode/hypotf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=hypot(5,4)+x +C=sqrtf(5*5+4*4)+x diff --git a/tests/10optimizer_bytecode/hypotl b/tests/10optimizer_bytecode/hypotl new file mode 100644 index 0000000..5d32b9a --- /dev/null +++ b/tests/10optimizer_bytecode/hypotl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=hypot(5,4)+x +C=sqrtl(5*5+4*4)+x diff --git a/tests/10optimizer_bytecode/hypotm b/tests/10optimizer_bytecode/hypotm new file mode 100644 index 0000000..73c7434 --- /dev/null +++ b/tests/10optimizer_bytecode/hypotm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=hypot(5,4)+x +C=MpfrFloat::hypot(5,4)+x diff --git a/tests/10optimizer_bytecode/immsub b/tests/10optimizer_bytecode/immsub new file mode 100644 index 0000000..2024891 --- /dev/null +++ b/tests/10optimizer_bytecode/immsub @@ -0,0 +1,5 @@ +T=d li +V=x +R=-6, 6, 1 +F=x-5 +C=x-5 diff --git a/tests/10optimizer_bytecode/int b/tests/10optimizer_bytecode/int new file mode 100644 index 0000000..407c7db --- /dev/null +++ b/tests/10optimizer_bytecode/int @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1.5, 1.5, 0.25 +F=x+sub(sub(sub(sub(sub(int(1.1), int(1.6)), int(1.5)), int(-1.1)), int(-1.6)), int(-1.5)) +C=x + (((((fp_int(1.1) - fp_int(1.6)) - fp_int(1.5)) - fp_int(-1.1)) - fp_int(-1.6)) - fp_int(-1.5)) diff --git a/tests/10optimizer_bytecode/intceil b/tests/10optimizer_bytecode/intceil new file mode 100644 index 0000000..a26dc85 --- /dev/null +++ b/tests/10optimizer_bytecode/intceil @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=ceil(x>4) +C=fp_ceil(fp_greater(x,4)) diff --git a/tests/10optimizer_bytecode/intfloor b/tests/10optimizer_bytecode/intfloor new file mode 100644 index 0000000..b7323e9 --- /dev/null +++ b/tests/10optimizer_bytecode/intfloor @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=floor(x>4) +C=fp_floor(fp_greater(x,4)) diff --git a/tests/10optimizer_bytecode/intint b/tests/10optimizer_bytecode/intint new file mode 100644 index 0000000..e1bafec --- /dev/null +++ b/tests/10optimizer_bytecode/intint @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=int(x>4) +C=fp_int(fp_greater(x,4)) diff --git a/tests/10optimizer_bytecode/inttrunc b/tests/10optimizer_bytecode/inttrunc new file mode 100644 index 0000000..f887a50 --- /dev/null +++ b/tests/10optimizer_bytecode/inttrunc @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=trunc(x>4) +C=fp_trunc(fp_greater(x,4)) diff --git a/tests/10optimizer_bytecode/invdiv b/tests/10optimizer_bytecode/invdiv new file mode 100644 index 0000000..b42971b --- /dev/null +++ b/tests/10optimizer_bytecode/invdiv @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-3,3,2 +F=y/(1/x) +C=y/(1/x) diff --git a/tests/10optimizer_bytecode/invinv b/tests/10optimizer_bytecode/invinv new file mode 100644 index 0000000..36ce291 --- /dev/null +++ b/tests/10optimizer_bytecode/invinv @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-3,3,2 +F=1/(1/x) +C=1/(1/x) diff --git a/tests/10optimizer_bytecode/invmul b/tests/10optimizer_bytecode/invmul new file mode 100644 index 0000000..acbd1dd --- /dev/null +++ b/tests/10optimizer_bytecode/invmul @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x,y +R=-3,3,2 +F=y*(1/x) +C=y*(1/x) diff --git a/tests/10optimizer_bytecode/invsincostan b/tests/10optimizer_bytecode/invsincostan new file mode 100644 index 0000000..343be9a --- /dev/null +++ b/tests/10optimizer_bytecode/invsincostan @@ -0,0 +1,62 @@ +T=ld +V=x,y +R=-0.7, 0.7, 0.28 +F=x/sin(y) + x/cos(y) + x/tan(y) + x/csc(y) + x/sec(y) + x/cot(y) + \ + 1/sin(y) + 1/cos(y) + 1/tan(y) + 1/csc(y) + 1/sec(y) + 1/cot(y) + +# Expected outcome after bytecode optimization: +# x*csc(y) + x*sec(y) + x*cot(y) +# + x*sin(y) + x*cos(y) + x*tan(y) +# + csc(y) + sec(y) + cot(y) +# + sin(y) + cos(y) + tan(y) + +# Expected intermediate form in tree optimization: +# x*sin(y)^-1 + x*cos(y)^-1 + x*cos(y)*sin(y)^-1 +# + x*sin(y) + x*cos(y) + x*sin(y)*cos(y)^-1 +# + sin(y)^-1 + cos(y)^-1 + cos(y)*sin(y)^-1 +# + sin(y) + cos(y) + sin(y)*cos(y)^-1 + +# One of possible outcomes after tree optimization: +# (x+1) * ( (sin(y)+cos(y)+tan(y)) + 1/(sin(y)+cos(y)+tan(y)) ) + +# One of possible outcomes after tree optimization: +# (x+1) * (sin(y) * (1 + cos(y)^-1) +# + cos(y) * (1 + sin(y)^-1) +# + sin(y)^-1 +# + cos(y)^-1) +# Note: sin(y) and cos(y) are subject to CSE and use of sincos(). +# which would optimally result in the following bytecode: +# 00 push y [0=y] +# 01 sincos [0=sin,1=cos] +# 02 dup [2=cos] +# 03 inv [2=cos^-1] +# 04 fetch 0 [3=sin] +# 06 inv [3=sin^-1] +# 07 push x [4=x] +# 08 push 1 [5=1] +# 09 add [4=x+1] +# 0A fetch 0 [5=sin] +# 0C push 1 [6=1] +# 0D fetch 2 [7=cos^-1] +# 0F add [6=1+cos^-1] +# 10 mul [5=sin * (1+cos^-1)] +# 11 fetch 1 [6=sin] +# 13 push 1 [7=1] +# 14 fetch 3 [8=sin^-1] +# 16 add [7=1+sin^-1] +# 17 mul [6=cos * (1+cos^-1)] +# 18 add [5=sin * (1+cos^-1) + cos * (1+cos^-1)] +# 19 fetch 3 [6=sin^-1] +# 1B add [5=sin * (1+cos^-1) + cos * (1+cos^-1) + sin^-1] +# 1C fetch 2 [6=cos^-1] +# 1E add [5=sin * (1+cos^-1) + cos * (1+cos^-1) + sin^-1 + cos^-1] +# 1F mul [4=result] +# 20 <end> + +# Unfortunately, the optimizer generates tan(), sec() and so on +# before it realizes the opportunities for sincos() use. + +C= x/fp_sin(y) + x/fp_cos(y) + x/fp_tan(y) \ + + x*fp_sin(y) + x*fp_cos(y) + x*fp_tan(y) \ + + 1/fp_sin(y) + 1/fp_cos(y) + 1/fp_tan(y) \ + + 1*fp_sin(y) + 1*fp_cos(y) + 1*fp_tan(y) diff --git a/tests/10optimizer_bytecode/leminushalf b/tests/10optimizer_bytecode/leminushalf new file mode 100644 index 0000000..f186f79 --- /dev/null +++ b/tests/10optimizer_bytecode/leminushalf @@ -0,0 +1,5 @@ +T=d f +V=x +R=-1,1,0.25 +F=x<=-0.5 +C=fp_lessOrEq(x, -0.5) diff --git a/tests/10optimizer_bytecode/log b/tests/10optimizer_bytecode/log new file mode 100644 index 0000000..42efe6c --- /dev/null +++ b/tests/10optimizer_bytecode/log @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=log(1.1)+x +C=log(1.1)+x diff --git a/tests/10optimizer_bytecode/log10 b/tests/10optimizer_bytecode/log10 new file mode 100644 index 0000000..40d09cf --- /dev/null +++ b/tests/10optimizer_bytecode/log10 @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=log10(1.1)+x +C=log(1.1)*0.43429448190325182765112891891660508229+x diff --git a/tests/10optimizer_bytecode/log10f b/tests/10optimizer_bytecode/log10f new file mode 100644 index 0000000..0892b30 --- /dev/null +++ b/tests/10optimizer_bytecode/log10f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=log10(1.1)+x +C=log10f(1.1)+x diff --git a/tests/10optimizer_bytecode/log10l b/tests/10optimizer_bytecode/log10l new file mode 100644 index 0000000..39895aa --- /dev/null +++ b/tests/10optimizer_bytecode/log10l @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=log10(1.1)+x +C=log10l(1.1)+x diff --git a/tests/10optimizer_bytecode/log10m b/tests/10optimizer_bytecode/log10m new file mode 100644 index 0000000..1a8215d --- /dev/null +++ b/tests/10optimizer_bytecode/log10m @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=log10(1.1)+x +C=MpfrFloat::log10(1.1)+x diff --git a/tests/10optimizer_bytecode/log2 b/tests/10optimizer_bytecode/log2 new file mode 100644 index 0000000..e2da926 --- /dev/null +++ b/tests/10optimizer_bytecode/log2 @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=log2(1.1)+x +C=log(1.1)*1.4426950408889634073599246810018921374266+x diff --git a/tests/10optimizer_bytecode/log2exp1 b/tests/10optimizer_bytecode/log2exp1 new file mode 100644 index 0000000..08f9031 --- /dev/null +++ b/tests/10optimizer_bytecode/log2exp1 @@ -0,0 +1,7 @@ +# x cLog2 cExp -> x (when not known whether x may be negative) + +T=d f +V=x +R=0, 3, 0.5 +F=exp(log2(x)) +C=fp_exp(fp_log2(x)) diff --git a/tests/10optimizer_bytecode/log2exp2 b/tests/10optimizer_bytecode/log2exp2 new file mode 100644 index 0000000..5fd5280 --- /dev/null +++ b/tests/10optimizer_bytecode/log2exp2 @@ -0,0 +1,7 @@ +# x cLog2 cExp2 -> x (when x is never negative) + +T=d f +V=x +R=-1,0.75,0.25 +F=exp2(log2(acos(x))) +C=fp_exp2(fp_log2(fp_acos(x))) diff --git a/tests/10optimizer_bytecode/log2f b/tests/10optimizer_bytecode/log2f new file mode 100644 index 0000000..23ad34e --- /dev/null +++ b/tests/10optimizer_bytecode/log2f @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=log2(1.1)+x +C=logf(1.1)*1.4426950408889634073599246810018921374266+x diff --git a/tests/10optimizer_bytecode/log2l b/tests/10optimizer_bytecode/log2l new file mode 100644 index 0000000..f8d0a50 --- /dev/null +++ b/tests/10optimizer_bytecode/log2l @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=log2(1.1)+x +C=logl(1.1)*1.4426950408889634073599246810018921374266+x diff --git a/tests/10optimizer_bytecode/log2m b/tests/10optimizer_bytecode/log2m new file mode 100644 index 0000000..b5fa3e4 --- /dev/null +++ b/tests/10optimizer_bytecode/log2m @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=log2(1.1)+x +C=MpfrFloat::log2(1.1)+x diff --git a/tests/10optimizer_bytecode/logexp1 b/tests/10optimizer_bytecode/logexp1 new file mode 100644 index 0000000..d9a44c4 --- /dev/null +++ b/tests/10optimizer_bytecode/logexp1 @@ -0,0 +1,7 @@ +# x cLog cExp -> x (when not known whether x may be negative) + +T=d f +V=x +R=0, 3, 0.5 +F=exp(log(x)) +C=fp_exp(fp_log(x)) diff --git a/tests/10optimizer_bytecode/logexp2 b/tests/10optimizer_bytecode/logexp2 new file mode 100644 index 0000000..29cac82 --- /dev/null +++ b/tests/10optimizer_bytecode/logexp2 @@ -0,0 +1,7 @@ +# x cLog cExp -> x (when x is never negative) + +T=d f +V=x +R=-1,0.75,0.25 +F=exp(log(acos(x))) +C=fp_exp(fp_log(fp_acos(x))) diff --git a/tests/10optimizer_bytecode/logf b/tests/10optimizer_bytecode/logf new file mode 100644 index 0000000..15f40c9 --- /dev/null +++ b/tests/10optimizer_bytecode/logf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=log(1.1)+x +C=logf(1.1)+x diff --git a/tests/10optimizer_bytecode/logl b/tests/10optimizer_bytecode/logl new file mode 100644 index 0000000..641bd6e --- /dev/null +++ b/tests/10optimizer_bytecode/logl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=log(1.1)+x +C=logl(1.1)+x diff --git a/tests/10optimizer_bytecode/logm b/tests/10optimizer_bytecode/logm new file mode 100644 index 0000000..dbcb808 --- /dev/null +++ b/tests/10optimizer_bytecode/logm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=log(1.1)+x +C=MpfrFloat::log(1.1)+x diff --git a/tests/10optimizer_bytecode/logmul b/tests/10optimizer_bytecode/logmul new file mode 100644 index 0000000..df4fae3 --- /dev/null +++ b/tests/10optimizer_bytecode/logmul @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-3,3,0.41 +F=log(1.1^x*4.1) +C=fp_log(fp_pow(1.1, x) * 4.1) diff --git a/tests/10optimizer_bytecode/logmul10 b/tests/10optimizer_bytecode/logmul10 new file mode 100644 index 0000000..7503240 --- /dev/null +++ b/tests/10optimizer_bytecode/logmul10 @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-3,3,0.41 +F=log10(1.1^x*4.1) +C=fp_log10(fp_pow(1.1, x) * 4.1) diff --git a/tests/10optimizer_bytecode/logmul2 b/tests/10optimizer_bytecode/logmul2 new file mode 100644 index 0000000..33c3c95 --- /dev/null +++ b/tests/10optimizer_bytecode/logmul2 @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-3,3,0.41 +F=log2(1.1^x*4.1) +C=fp_log2(fp_pow(1.1, x) * 4.1) diff --git a/tests/10optimizer_bytecode/lt0 b/tests/10optimizer_bytecode/lt0 new file mode 100644 index 0000000..10768cc --- /dev/null +++ b/tests/10optimizer_bytecode/lt0 @@ -0,0 +1,5 @@ +T=d f li +V=x +R=-1,1,1 +F=sub(abs(x)<0, x<0) +C=fp_less(fp_abs(x),x-x) - fp_less(x,x-x) diff --git a/tests/10optimizer_bytecode/lthalf b/tests/10optimizer_bytecode/lthalf new file mode 100644 index 0000000..2d08079 --- /dev/null +++ b/tests/10optimizer_bytecode/lthalf @@ -0,0 +1,5 @@ +T=d f +V=x +R=-1,1,0.25 +F=x<0.5 +C=fp_less(x, 0.5) diff --git a/tests/10optimizer_bytecode/max b/tests/10optimizer_bytecode/max new file mode 100644 index 0000000..3168206 --- /dev/null +++ b/tests/10optimizer_bytecode/max @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x +R=0,1,1 +F=max(5,4)+x +C=5+x diff --git a/tests/10optimizer_bytecode/min b/tests/10optimizer_bytecode/min new file mode 100644 index 0000000..fdd22b1 --- /dev/null +++ b/tests/10optimizer_bytecode/min @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x +R=0,1,1 +F=min(4,5)+x +C=4+x diff --git a/tests/10optimizer_bytecode/mod b/tests/10optimizer_bytecode/mod new file mode 100644 index 0000000..3e33397 --- /dev/null +++ b/tests/10optimizer_bytecode/mod @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5%4)+x +C=fp_mod(5,4)+x diff --git a/tests/10optimizer_bytecode/mul b/tests/10optimizer_bytecode/mul new file mode 100644 index 0000000..a99b63b --- /dev/null +++ b/tests/10optimizer_bytecode/mul @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(5*4)+x +C=(5*4)+x diff --git a/tests/10optimizer_bytecode/mul1 b/tests/10optimizer_bytecode/mul1 new file mode 100644 index 0000000..00e9739 --- /dev/null +++ b/tests/10optimizer_bytecode/mul1 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=x*1+x +C=x*1+x diff --git a/tests/10optimizer_bytecode/mul1b b/tests/10optimizer_bytecode/mul1b new file mode 100644 index 0000000..d8a4f8d --- /dev/null +++ b/tests/10optimizer_bytecode/mul1b @@ -0,0 +1,5 @@ +T=d f +V=x +R=0,1,1 +F=((x*0.2)*5)+x +C=((x*0.2)*5)+x diff --git a/tests/10optimizer_bytecode/mul2 b/tests/10optimizer_bytecode/mul2 new file mode 100644 index 0000000..e0f05df --- /dev/null +++ b/tests/10optimizer_bytecode/mul2 @@ -0,0 +1,5 @@ +T=d f ld li mf gi +V=x +R=0,1,1 +F=x*2 +C=x+x diff --git a/tests/10optimizer_bytecode/mul4 b/tests/10optimizer_bytecode/mul4 new file mode 100644 index 0000000..37f0716 --- /dev/null +++ b/tests/10optimizer_bytecode/mul4 @@ -0,0 +1,5 @@ +T=d f ld li mf gi +V=x,y +R=-3,3,1 +F=y*(x*2)*2 + (y*2)*2 +C=y*(x*2)*2 + (y*2)*2 diff --git a/tests/10optimizer_bytecode/mul_zero b/tests/10optimizer_bytecode/mul_zero new file mode 100644 index 0000000..7c354df --- /dev/null +++ b/tests/10optimizer_bytecode/mul_zero @@ -0,0 +1,6 @@ +# multiplications by zero +T=d f +V=x,y +R=0.1,10,0.1 +F=(x*y+1)+(sin(x)+sin(y))*log(x)*y*x*0 +C=(x*y+1)+(fp_sin(x)+fp_sin(y))*fp_log(x)*y*x*0 diff --git a/tests/10optimizer_bytecode/mulminus1 b/tests/10optimizer_bytecode/mulminus1 new file mode 100644 index 0000000..d5b0ddb --- /dev/null +++ b/tests/10optimizer_bytecode/mulminus1 @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=x*-1 +C=x*-1 diff --git a/tests/10optimizer_bytecode/mulneg b/tests/10optimizer_bytecode/mulneg new file mode 100644 index 0000000..cdd9b11 --- /dev/null +++ b/tests/10optimizer_bytecode/mulneg @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=-(x*5) +C=-(x*5) diff --git a/tests/10optimizer_bytecode/multodiv b/tests/10optimizer_bytecode/multodiv new file mode 100644 index 0000000..344ebff --- /dev/null +++ b/tests/10optimizer_bytecode/multodiv @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=x/4+x +C=x/4+x diff --git a/tests/10optimizer_bytecode/neg b/tests/10optimizer_bytecode/neg new file mode 100644 index 0000000..0e6c4c8 --- /dev/null +++ b/tests/10optimizer_bytecode/neg @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=((-((5))))+x +C=((-((5))))+x diff --git a/tests/10optimizer_bytecode/negabs b/tests/10optimizer_bytecode/negabs new file mode 100644 index 0000000..42b20fc --- /dev/null +++ b/tests/10optimizer_bytecode/negabs @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=abs(-x) +C=fp_abs(-x) diff --git a/tests/10optimizer_bytecode/negadd b/tests/10optimizer_bytecode/negadd new file mode 100644 index 0000000..7744f10 --- /dev/null +++ b/tests/10optimizer_bytecode/negadd @@ -0,0 +1,5 @@ +T=d li +V=x,y +R=-6, 6, 1 +F=x+(-y) +C=x+(-y) diff --git a/tests/10optimizer_bytecode/negceil b/tests/10optimizer_bytecode/negceil new file mode 100644 index 0000000..b40b89f --- /dev/null +++ b/tests/10optimizer_bytecode/negceil @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=-ceil(x) +C=-fp_ceil(x) diff --git a/tests/10optimizer_bytecode/negcos b/tests/10optimizer_bytecode/negcos new file mode 100644 index 0000000..7e36ff0 --- /dev/null +++ b/tests/10optimizer_bytecode/negcos @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=cos(-x) +C=fp_cos(-x) diff --git a/tests/10optimizer_bytecode/negcosh b/tests/10optimizer_bytecode/negcosh new file mode 100644 index 0000000..47e4f01 --- /dev/null +++ b/tests/10optimizer_bytecode/negcosh @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=cosh(-x) +C=fp_cosh(-x) diff --git a/tests/10optimizer_bytecode/negdiv b/tests/10optimizer_bytecode/negdiv new file mode 100644 index 0000000..1fa42bf --- /dev/null +++ b/tests/10optimizer_bytecode/negdiv @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=(-x)/5 +C=(-x)/5 diff --git a/tests/10optimizer_bytecode/negfloor b/tests/10optimizer_bytecode/negfloor new file mode 100644 index 0000000..e07604b --- /dev/null +++ b/tests/10optimizer_bytecode/negfloor @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,0.5 +F=-floor(x) +C=-fp_floor(x) diff --git a/tests/10optimizer_bytecode/negmul b/tests/10optimizer_bytecode/negmul new file mode 100644 index 0000000..ec79086 --- /dev/null +++ b/tests/10optimizer_bytecode/negmul @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(-x)*5 +C=(-x)*5 diff --git a/tests/10optimizer_bytecode/negneg b/tests/10optimizer_bytecode/negneg new file mode 100644 index 0000000..5c5a63b --- /dev/null +++ b/tests/10optimizer_bytecode/negneg @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-3,3,2 +F=-(-(-(-(-(-(x)))))) +C=-(-(-(-(-(-(x)))))) diff --git a/tests/10optimizer_bytecode/negnot b/tests/10optimizer_bytecode/negnot new file mode 100644 index 0000000..fa8e6fc --- /dev/null +++ b/tests/10optimizer_bytecode/negnot @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=!(-x) +C=fp_not(-x) diff --git a/tests/10optimizer_bytecode/negsin b/tests/10optimizer_bytecode/negsin new file mode 100644 index 0000000..e935649 --- /dev/null +++ b/tests/10optimizer_bytecode/negsin @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=sin(-x) +C=fp_sin(-x) diff --git a/tests/10optimizer_bytecode/negsinh b/tests/10optimizer_bytecode/negsinh new file mode 100644 index 0000000..a1f7791 --- /dev/null +++ b/tests/10optimizer_bytecode/negsinh @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=sinh(-x) +C=fp_sinh(-x) diff --git a/tests/10optimizer_bytecode/negsqr b/tests/10optimizer_bytecode/negsqr new file mode 100644 index 0000000..8efc4e9 --- /dev/null +++ b/tests/10optimizer_bytecode/negsqr @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=(-x)*(-x) +C=x*x diff --git a/tests/10optimizer_bytecode/negsub b/tests/10optimizer_bytecode/negsub new file mode 100644 index 0000000..3bae30b --- /dev/null +++ b/tests/10optimizer_bytecode/negsub @@ -0,0 +1,5 @@ +T=d li +V=x,y +R=-6, 6, 1 +F=x-(-y) +C=x-(-y) diff --git a/tests/10optimizer_bytecode/negtan b/tests/10optimizer_bytecode/negtan new file mode 100644 index 0000000..0eb5c84 --- /dev/null +++ b/tests/10optimizer_bytecode/negtan @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=tan(-x) +C=fp_tan(-x) diff --git a/tests/10optimizer_bytecode/negtanh b/tests/10optimizer_bytecode/negtanh new file mode 100644 index 0000000..e207cf6 --- /dev/null +++ b/tests/10optimizer_bytecode/negtanh @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=tanh(-x) +C=fp_tanh(-x) diff --git a/tests/10optimizer_bytecode/neq0 b/tests/10optimizer_bytecode/neq0 new file mode 100644 index 0000000..9517d3c --- /dev/null +++ b/tests/10optimizer_bytecode/neq0 @@ -0,0 +1,5 @@ +T=d f ld li +V=x +R=0,1,1 +F=(x!=0) + (0!=x) +C=(fp_nequal(x,0)) + (fp_nequal(0,x)) diff --git a/tests/10optimizer_bytecode/neq1 b/tests/10optimizer_bytecode/neq1 new file mode 100644 index 0000000..d968fab --- /dev/null +++ b/tests/10optimizer_bytecode/neq1 @@ -0,0 +1,6 @@ +T=d f ld li +V=x +R=0,1,1 +F=(!x!=1) +C=fp_nequal(fp_not(x),1) + diff --git a/tests/10optimizer_bytecode/not b/tests/10optimizer_bytecode/not new file mode 100644 index 0000000..3263631 --- /dev/null +++ b/tests/10optimizer_bytecode/not @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(!(3))+x +C=fp_not(3)+x diff --git a/tests/10optimizer_bytecode/not_eq b/tests/10optimizer_bytecode/not_eq new file mode 100644 index 0000000..d617d2b --- /dev/null +++ b/tests/10optimizer_bytecode/not_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi +V=x,y +R=0,1,1 +F= !(x = y) +C= x != y diff --git a/tests/10optimizer_bytecode/not_ge b/tests/10optimizer_bytecode/not_ge new file mode 100644 index 0000000..d54dda2 --- /dev/null +++ b/tests/10optimizer_bytecode/not_ge @@ -0,0 +1,5 @@ +T=d ld li f mf gi +V=x,y +R=0,1,1 +F= !(x >= y) +C= x < y diff --git a/tests/10optimizer_bytecode/not_gt b/tests/10optimizer_bytecode/not_gt new file mode 100644 index 0000000..5efebcb --- /dev/null +++ b/tests/10optimizer_bytecode/not_gt @@ -0,0 +1,5 @@ +T=d ld li f mf gi +V=x,y +R=0,1,1 +F= !(x > y) +C= x <= y diff --git a/tests/10optimizer_bytecode/not_le b/tests/10optimizer_bytecode/not_le new file mode 100644 index 0000000..48f712b --- /dev/null +++ b/tests/10optimizer_bytecode/not_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi +V=x,y +R=0,1,1 +F= !(x <= y) +C= x > y diff --git a/tests/10optimizer_bytecode/not_lt b/tests/10optimizer_bytecode/not_lt new file mode 100644 index 0000000..c8d5d92 --- /dev/null +++ b/tests/10optimizer_bytecode/not_lt @@ -0,0 +1,5 @@ +T=d ld li f mf gi +V=x,y +R=0,1,1 +F= !(x < y) +C= x >= y diff --git a/tests/10optimizer_bytecode/not_ne b/tests/10optimizer_bytecode/not_ne new file mode 100644 index 0000000..c45ce99 --- /dev/null +++ b/tests/10optimizer_bytecode/not_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi +V=x,y +R=0,1,1 +F= !(x != y) +C= x == y diff --git a/tests/10optimizer_bytecode/notnot b/tests/10optimizer_bytecode/notnot new file mode 100644 index 0000000..e2936b8 --- /dev/null +++ b/tests/10optimizer_bytecode/notnot @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=!!(x) +C=fp_notNot(x) diff --git a/tests/10optimizer_bytecode/notnotnot b/tests/10optimizer_bytecode/notnotnot new file mode 100644 index 0000000..cf98dfd --- /dev/null +++ b/tests/10optimizer_bytecode/notnotnot @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=!!!(x) +C=fp_not(x) diff --git a/tests/10optimizer_bytecode/notnotnot2 b/tests/10optimizer_bytecode/notnotnot2 new file mode 100644 index 0000000..88594e4 --- /dev/null +++ b/tests/10optimizer_bytecode/notnotnot2 @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=!x&!x +C=fp_not(x) diff --git a/tests/10optimizer_bytecode/or b/tests/10optimizer_bytecode/or new file mode 100644 index 0000000..284963d --- /dev/null +++ b/tests/10optimizer_bytecode/or @@ -0,0 +1,6 @@ +T=d li +V=x +R=0,1,1 +F=(5|3)+x+(5|0)+(0|5)+(0|0) +C=fp_or(5,3)+x+fp_or(5,0)+fp_or(0,5)+fp_or(0,0) + diff --git a/tests/10optimizer_bytecode/pow_neg b/tests/10optimizer_bytecode/pow_neg new file mode 100644 index 0000000..9062019 --- /dev/null +++ b/tests/10optimizer_bytecode/pow_neg @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=pow(-0.25,4)+x +C=pow(-0.25,4)+x diff --git a/tests/10optimizer_bytecode/pow_negf b/tests/10optimizer_bytecode/pow_negf new file mode 100644 index 0000000..9ac6d39 --- /dev/null +++ b/tests/10optimizer_bytecode/pow_negf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=pow(-0.25,4)+x +C=powf(-0.25,4)+x diff --git a/tests/10optimizer_bytecode/pow_negl b/tests/10optimizer_bytecode/pow_negl new file mode 100644 index 0000000..a615f13 --- /dev/null +++ b/tests/10optimizer_bytecode/pow_negl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=pow(-0.25,4)+x +C=powl(-0.25,4)+x diff --git a/tests/10optimizer_bytecode/pow_negm b/tests/10optimizer_bytecode/pow_negm new file mode 100644 index 0000000..2d8653a --- /dev/null +++ b/tests/10optimizer_bytecode/pow_negm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=pow(-0.25,4)+x +C=MpfrFloat::pow(-0.25,4)+x diff --git a/tests/10optimizer_bytecode/pow_pos b/tests/10optimizer_bytecode/pow_pos new file mode 100644 index 0000000..fce90c4 --- /dev/null +++ b/tests/10optimizer_bytecode/pow_pos @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=pow(1.1, 7.1)+x +C=pow(1.1, 7.1)+x diff --git a/tests/10optimizer_bytecode/pow_posf b/tests/10optimizer_bytecode/pow_posf new file mode 100644 index 0000000..d979261 --- /dev/null +++ b/tests/10optimizer_bytecode/pow_posf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=pow(1.1, 7.1)+x +C=powf(1.1, 7.1)+x diff --git a/tests/10optimizer_bytecode/pow_posl b/tests/10optimizer_bytecode/pow_posl new file mode 100644 index 0000000..a8aec3a --- /dev/null +++ b/tests/10optimizer_bytecode/pow_posl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=pow(1.1, 7.1)+x +C=powl(1.1, 7.1)+x diff --git a/tests/10optimizer_bytecode/pow_posm b/tests/10optimizer_bytecode/pow_posm new file mode 100644 index 0000000..52ec25b --- /dev/null +++ b/tests/10optimizer_bytecode/pow_posm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=pow(1.1, 7.1)+x +C=MpfrFloat::pow(1.1, 7.1)+x diff --git a/tests/10optimizer_bytecode/powdiv b/tests/10optimizer_bytecode/powdiv new file mode 100644 index 0000000..d89d134 --- /dev/null +++ b/tests/10optimizer_bytecode/powdiv @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-3,3,2 +F=x/pow(x,y) +C=x/fp_pow(x,y) diff --git a/tests/10optimizer_bytecode/powhalf b/tests/10optimizer_bytecode/powhalf new file mode 100644 index 0000000..95aec78 --- /dev/null +++ b/tests/10optimizer_bytecode/powhalf @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=0,4,0.1 +F=pow(x,0.5) +C=fp_pow(x,0.5) diff --git a/tests/10optimizer_bytecode/powinv b/tests/10optimizer_bytecode/powinv new file mode 100644 index 0000000..1626da8 --- /dev/null +++ b/tests/10optimizer_bytecode/powinv @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-3,3,2 +F=1/pow(x,y) +C=1/fp_pow(x,y) diff --git a/tests/10optimizer_bytecode/powminushalf b/tests/10optimizer_bytecode/powminushalf new file mode 100644 index 0000000..81366a6 --- /dev/null +++ b/tests/10optimizer_bytecode/powminushalf @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=0,4,0.1 +F=pow(x,-0.5) +C=fp_pow(x,-0.5) diff --git a/tests/10optimizer_bytecode/powminusone b/tests/10optimizer_bytecode/powminusone new file mode 100644 index 0000000..2efcedf --- /dev/null +++ b/tests/10optimizer_bytecode/powminusone @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=1,5,1 +F=pow(x,-1.0) +C=fp_pow(x,-1.0) diff --git a/tests/10optimizer_bytecode/powminusthird b/tests/10optimizer_bytecode/powminusthird new file mode 100644 index 0000000..6b4fb97 --- /dev/null +++ b/tests/10optimizer_bytecode/powminusthird @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=0,4,0.1 +F=pow(x,(-1.0/3.0)) +C=fp_pow(x,(-1.0/3.0)) diff --git a/tests/10optimizer_bytecode/powthird b/tests/10optimizer_bytecode/powthird new file mode 100644 index 0000000..9a05e2e --- /dev/null +++ b/tests/10optimizer_bytecode/powthird @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=0,4,0.1 +F=pow(x,(1.0/3.0)) +C=fp_pow(x,(1.0/3.0)) diff --git a/tests/10optimizer_bytecode/powxpow b/tests/10optimizer_bytecode/powxpow new file mode 100644 index 0000000..c3ea5c5 --- /dev/null +++ b/tests/10optimizer_bytecode/powxpow @@ -0,0 +1,6 @@ +# cPow x [IsIntegerConst(x)] cPow -> [x] cMul cPow +T=d +V=x +R=-.1,.1,0.01 +F=(x^1.7)^1506 +C=fp_pow(fp_pow(x,1.7),1506) diff --git a/tests/10optimizer_bytecode/rad b/tests/10optimizer_bytecode/rad new file mode 100644 index 0000000..a43f035 --- /dev/null +++ b/tests/10optimizer_bytecode/rad @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-10,10,0.8 +F=(pi/180)*y + x*(pi/180) + (x*(pi/180))*4 +C=d2r(y) + d2r(x) + d2r(x)*4 diff --git a/tests/10optimizer_bytecode/radxmul b/tests/10optimizer_bytecode/radxmul new file mode 100644 index 0000000..21482b4 --- /dev/null +++ b/tests/10optimizer_bytecode/radxmul @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-2,2,0.8 +F=cos((x*pi/180)*4) +C=fp_cos(d2r(x+x+x+x)) diff --git a/tests/10optimizer_bytecode/rsqrt b/tests/10optimizer_bytecode/rsqrt new file mode 100644 index 0000000..452038f --- /dev/null +++ b/tests/10optimizer_bytecode/rsqrt @@ -0,0 +1,6 @@ +# cSqrt cInv -> cRSqrt +T=d +V=x +R=0.01,10,0.05 +F=1/sqrt(x) +C=1/fp_sqrt(x) diff --git a/tests/10optimizer_bytecode/sin b/tests/10optimizer_bytecode/sin new file mode 100644 index 0000000..6b2ad23 --- /dev/null +++ b/tests/10optimizer_bytecode/sin @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=sin(1.1)+x +C=sin(1.1)+x diff --git a/tests/10optimizer_bytecode/sin_deg b/tests/10optimizer_bytecode/sin_deg new file mode 100644 index 0000000..393bfbf --- /dev/null +++ b/tests/10optimizer_bytecode/sin_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=sin(1.1)+x +C=sin(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sincos_cci b/tests/10optimizer_bytecode/sincos_cci new file mode 100644 index 0000000..8c4b368 --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_cci @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=cos(x) + sec(x) +C=fp_cos(x) + 1/fp_cos(x) diff --git a/tests/10optimizer_bytecode/sincos_cic b/tests/10optimizer_bytecode/sincos_cic new file mode 100644 index 0000000..ddc9343 --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_cic @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=sec(x) + cos(x) +C=1/fp_cos(x) + fp_cos(x) diff --git a/tests/10optimizer_bytecode/sincos_sc b/tests/10optimizer_bytecode/sincos_sc new file mode 100644 index 0000000..b93045b --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_sc @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=sin(x) + cos(x) +C=fp_sin(x) + fp_cos(x) diff --git a/tests/10optimizer_bytecode/sincos_sci b/tests/10optimizer_bytecode/sincos_sci new file mode 100644 index 0000000..d20756f --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_sci @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=sin(x) + sec(x) +C=fp_sin(x) + 1/fp_cos(x) diff --git a/tests/10optimizer_bytecode/sincos_sis b/tests/10optimizer_bytecode/sincos_sis new file mode 100644 index 0000000..ebdd783 --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_sis @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=csc(x) + sin(x) +C=1/fp_sin(x) + fp_sin(x) diff --git a/tests/10optimizer_bytecode/sincos_ssi b/tests/10optimizer_bytecode/sincos_ssi new file mode 100644 index 0000000..f1d1dfb --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_ssi @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=sin(x) + csc(x) +C=fp_sin(x) + 1/fp_sin(x) diff --git a/tests/10optimizer_bytecode/sincos_tan b/tests/10optimizer_bytecode/sincos_tan new file mode 100644 index 0000000..2a155e6 --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_tan @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=sin(x) / cos(x) +C=fp_tan(x) diff --git a/tests/10optimizer_bytecode/sincos_tit b/tests/10optimizer_bytecode/sincos_tit new file mode 100644 index 0000000..e68d427 --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_tit @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=cot(x) + tan(x) +C=1/fp_tan(x) + fp_tan(x) diff --git a/tests/10optimizer_bytecode/sincos_tti b/tests/10optimizer_bytecode/sincos_tti new file mode 100644 index 0000000..e85652e --- /dev/null +++ b/tests/10optimizer_bytecode/sincos_tti @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=-0.7, 0.7, 0.28 +F=tan(x) + cot(x) +C=fp_tan(x) + 1/fp_tan(x) diff --git a/tests/10optimizer_bytecode/sinf b/tests/10optimizer_bytecode/sinf new file mode 100644 index 0000000..aaccd87 --- /dev/null +++ b/tests/10optimizer_bytecode/sinf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=sin(1.1)+x +C=sinf(1.1)+x diff --git a/tests/10optimizer_bytecode/sinf_deg b/tests/10optimizer_bytecode/sinf_deg new file mode 100644 index 0000000..965c3a0 --- /dev/null +++ b/tests/10optimizer_bytecode/sinf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=sin(1.1)+x +C=sinf(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sinh b/tests/10optimizer_bytecode/sinh new file mode 100644 index 0000000..bc63a6a --- /dev/null +++ b/tests/10optimizer_bytecode/sinh @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=sinh(1.1)+x +C=sinh(1.1)+x diff --git a/tests/10optimizer_bytecode/sinh_deg b/tests/10optimizer_bytecode/sinh_deg new file mode 100644 index 0000000..f8ab21c --- /dev/null +++ b/tests/10optimizer_bytecode/sinh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=sinh(1.1)+x +C=sinh(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sinhf b/tests/10optimizer_bytecode/sinhf new file mode 100644 index 0000000..24d8512 --- /dev/null +++ b/tests/10optimizer_bytecode/sinhf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=sinh(1.1)+x +C=sinhf(1.1)+x diff --git a/tests/10optimizer_bytecode/sinhf_deg b/tests/10optimizer_bytecode/sinhf_deg new file mode 100644 index 0000000..53d555e --- /dev/null +++ b/tests/10optimizer_bytecode/sinhf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=sinh(1.1)+x +C=sinhf(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sinhl b/tests/10optimizer_bytecode/sinhl new file mode 100644 index 0000000..b922810 --- /dev/null +++ b/tests/10optimizer_bytecode/sinhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=sinh(1.1)+x +C=sinhl(1.1)+x diff --git a/tests/10optimizer_bytecode/sinhl_deg b/tests/10optimizer_bytecode/sinhl_deg new file mode 100644 index 0000000..527dc9b --- /dev/null +++ b/tests/10optimizer_bytecode/sinhl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=sinh(1.1)+x +C=sinhl(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sinhm b/tests/10optimizer_bytecode/sinhm new file mode 100644 index 0000000..f8f7cbf --- /dev/null +++ b/tests/10optimizer_bytecode/sinhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=sinh(1.1)+x +C=MpfrFloat::sinh(1.1)+x diff --git a/tests/10optimizer_bytecode/sinhm_deg b/tests/10optimizer_bytecode/sinhm_deg new file mode 100644 index 0000000..0386b19 --- /dev/null +++ b/tests/10optimizer_bytecode/sinhm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=sinh(1.1)+x +C=MpfrFloat::sinh(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sinl b/tests/10optimizer_bytecode/sinl new file mode 100644 index 0000000..a03b4e3 --- /dev/null +++ b/tests/10optimizer_bytecode/sinl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=sin(1.1)+x +C=sinl(1.1)+x diff --git a/tests/10optimizer_bytecode/sinl_deg b/tests/10optimizer_bytecode/sinl_deg new file mode 100644 index 0000000..d9b41ce --- /dev/null +++ b/tests/10optimizer_bytecode/sinl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=sin(1.1)+x +C=sinl(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sinm b/tests/10optimizer_bytecode/sinm new file mode 100644 index 0000000..8ec385d --- /dev/null +++ b/tests/10optimizer_bytecode/sinm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=sin(1.1)+x +C=MpfrFloat::sin(1.1)+x diff --git a/tests/10optimizer_bytecode/sinm_deg b/tests/10optimizer_bytecode/sinm_deg new file mode 100644 index 0000000..46ca1e9 --- /dev/null +++ b/tests/10optimizer_bytecode/sinm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=sin(1.1)+x +C=MpfrFloat::sin(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/sqr_nxx b/tests/10optimizer_bytecode/sqr_nxx new file mode 100644 index 0000000..33d6949 --- /dev/null +++ b/tests/10optimizer_bytecode/sqr_nxx @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=(-x)*x +C=(-x)*x diff --git a/tests/10optimizer_bytecode/sqr_xnx b/tests/10optimizer_bytecode/sqr_xnx new file mode 100644 index 0000000..fcabb3b --- /dev/null +++ b/tests/10optimizer_bytecode/sqr_xnx @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=x*(-x) +C=x*(-x) diff --git a/tests/10optimizer_bytecode/sqr_xx b/tests/10optimizer_bytecode/sqr_xx new file mode 100644 index 0000000..3bdb82e --- /dev/null +++ b/tests/10optimizer_bytecode/sqr_xx @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=x*x +C=x*x diff --git a/tests/10optimizer_bytecode/sqr_ynxx b/tests/10optimizer_bytecode/sqr_ynxx new file mode 100644 index 0000000..f467eed --- /dev/null +++ b/tests/10optimizer_bytecode/sqr_ynxx @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x,y +R=-1,1,1 +F=y*-x*x +C=y*-x*x diff --git a/tests/10optimizer_bytecode/sqr_yxnx b/tests/10optimizer_bytecode/sqr_yxnx new file mode 100644 index 0000000..0917446 --- /dev/null +++ b/tests/10optimizer_bytecode/sqr_yxnx @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x,y +R=-1,1,1 +F=y*x*-x +C=y*x*-x diff --git a/tests/10optimizer_bytecode/sqr_yxx b/tests/10optimizer_bytecode/sqr_yxx new file mode 100644 index 0000000..fd9470f --- /dev/null +++ b/tests/10optimizer_bytecode/sqr_yxx @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x,y +R=-1,1,1 +F=y*x*x +C=y*x*x diff --git a/tests/10optimizer_bytecode/sqreq0 b/tests/10optimizer_bytecode/sqreq0 new file mode 100644 index 0000000..07ad468 --- /dev/null +++ b/tests/10optimizer_bytecode/sqreq0 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(x*x=0) + (0=x*x) +C=fp_equal(x*x,0) + fp_equal(0,x*x) diff --git a/tests/10optimizer_bytecode/sqrlog b/tests/10optimizer_bytecode/sqrlog new file mode 100644 index 0000000..927cc3c --- /dev/null +++ b/tests/10optimizer_bytecode/sqrlog @@ -0,0 +1,6 @@ +# cSqr cLog -> cAbs cLog cDup cAdd +T=d f ld mf +V=x +R=-10,10,0.8 +F=log(x^2) +C=fp_log(x*x) diff --git a/tests/10optimizer_bytecode/sqrlog10 b/tests/10optimizer_bytecode/sqrlog10 new file mode 100644 index 0000000..fca65e3 --- /dev/null +++ b/tests/10optimizer_bytecode/sqrlog10 @@ -0,0 +1,6 @@ +# cSqr cLog -> cAbs cLog cDup cAdd +T=d f ld mf +V=x +R=-10,10,0.8 +F=log10(x^2) +C=fp_log10(x*x) diff --git a/tests/10optimizer_bytecode/sqrlog2 b/tests/10optimizer_bytecode/sqrlog2 new file mode 100644 index 0000000..9acddf2 --- /dev/null +++ b/tests/10optimizer_bytecode/sqrlog2 @@ -0,0 +1,6 @@ +# cSqr cLog -> cAbs cLog cDup cAdd +T=d f ld mf +V=x +R=-10,10,0.8 +F=log2(x^2) +C=fp_log2(x*x) diff --git a/tests/10optimizer_bytecode/sqrneq0 b/tests/10optimizer_bytecode/sqrneq0 new file mode 100644 index 0000000..07ad468 --- /dev/null +++ b/tests/10optimizer_bytecode/sqrneq0 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=(x*x=0) + (0=x*x) +C=fp_equal(x*x,0) + fp_equal(0,x*x) diff --git a/tests/10optimizer_bytecode/sqrsqrt b/tests/10optimizer_bytecode/sqrsqrt new file mode 100644 index 0000000..83c9711 --- /dev/null +++ b/tests/10optimizer_bytecode/sqrsqrt @@ -0,0 +1,6 @@ +# cSqr cSqrt +T=d +V=x +R=-10,10,0.1 +F=sqrt(x^2) +C=fp_sqrt(x*x) diff --git a/tests/10optimizer_bytecode/sqrt b/tests/10optimizer_bytecode/sqrt new file mode 100644 index 0000000..a1165ec --- /dev/null +++ b/tests/10optimizer_bytecode/sqrt @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=sqrt(1.1)+x +C=sqrt(1.1)+x diff --git a/tests/10optimizer_bytecode/sqrtf b/tests/10optimizer_bytecode/sqrtf new file mode 100644 index 0000000..b8c7603 --- /dev/null +++ b/tests/10optimizer_bytecode/sqrtf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=sqrt(1.1)+x +C=sqrtf(1.1)+x diff --git a/tests/10optimizer_bytecode/sqrtl b/tests/10optimizer_bytecode/sqrtl new file mode 100644 index 0000000..018c8ef --- /dev/null +++ b/tests/10optimizer_bytecode/sqrtl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=sqrt(1.1)+x +C=sqrtl(1.1)+x diff --git a/tests/10optimizer_bytecode/sqrtm b/tests/10optimizer_bytecode/sqrtm new file mode 100644 index 0000000..cc71883 --- /dev/null +++ b/tests/10optimizer_bytecode/sqrtm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=sqrt(1.1)+x +C=MpfrFloat::sqrt(1.1)+x diff --git a/tests/10optimizer_bytecode/sqrtsqr1 b/tests/10optimizer_bytecode/sqrtsqr1 new file mode 100644 index 0000000..eaf5a2d --- /dev/null +++ b/tests/10optimizer_bytecode/sqrtsqr1 @@ -0,0 +1,7 @@ +# x cSqrt cSqr -> x (when not known whether x may be negative) + +T=d f +V=x +R=0, 3, 0.5 +F=sqrt(x)^2 +C=fp_pow(fp_sqrt(x), 2) diff --git a/tests/10optimizer_bytecode/sqrtsqr2 b/tests/10optimizer_bytecode/sqrtsqr2 new file mode 100644 index 0000000..ff0673a --- /dev/null +++ b/tests/10optimizer_bytecode/sqrtsqr2 @@ -0,0 +1,7 @@ +# x cSqrt cSqr -> x (when x is never negative) + +T=d f +V=x +R=-1,1,0.5 +F=sqrt(acos(x))^2 +C=fp_pow(fp_sqrt(fp_acos(x)), 2) diff --git a/tests/10optimizer_bytecode/sqrxpow b/tests/10optimizer_bytecode/sqrxpow new file mode 100644 index 0000000..5de6cb0 --- /dev/null +++ b/tests/10optimizer_bytecode/sqrxpow @@ -0,0 +1,6 @@ +# cSqr x cPow -> [x+x] cPow +T=d +V=x +R=-.1,.1,0.01 +F=(x^2)^2402 +C=fp_pow(x*x, 2402) diff --git a/tests/10optimizer_bytecode/sqrxpow_nonint b/tests/10optimizer_bytecode/sqrxpow_nonint new file mode 100644 index 0000000..bb505df --- /dev/null +++ b/tests/10optimizer_bytecode/sqrxpow_nonint @@ -0,0 +1,6 @@ +# cSqr x [!isEvenInteger(x+x)] cPow -> cAbs [x+x] cPow +T=d +V=x +R=-10,10,0.1 +F=(x^2)^3.5 +C=fp_pow(x*x, 3.5) diff --git a/tests/10optimizer_bytecode/sub b/tests/10optimizer_bytecode/sub new file mode 100644 index 0000000..4b4b764 --- /dev/null +++ b/tests/10optimizer_bytecode/sub @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=5-3+x +C=5-3+x diff --git a/tests/10optimizer_bytecode/sub0 b/tests/10optimizer_bytecode/sub0 new file mode 100644 index 0000000..57f4912 --- /dev/null +++ b/tests/10optimizer_bytecode/sub0 @@ -0,0 +1,5 @@ +T=d li +V=x +R=0,1,1 +F=x-0+x +C=x-0+x diff --git a/tests/10optimizer_bytecode/subxx b/tests/10optimizer_bytecode/subxx new file mode 100644 index 0000000..5845010 --- /dev/null +++ b/tests/10optimizer_bytecode/subxx @@ -0,0 +1,5 @@ +T=d li f ld +V=x +R=-3,3,1 +F=x+(x-x)+x+(1-x+x) +C=x+(x-x)+x+(1-x+x) diff --git a/tests/10optimizer_bytecode/tan b/tests/10optimizer_bytecode/tan new file mode 100644 index 0000000..1c95ffb --- /dev/null +++ b/tests/10optimizer_bytecode/tan @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=tan(1.1)+x +C=tan(1.1)+x diff --git a/tests/10optimizer_bytecode/tan_deg b/tests/10optimizer_bytecode/tan_deg new file mode 100644 index 0000000..9875a86 --- /dev/null +++ b/tests/10optimizer_bytecode/tan_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=tan(1.1)+x +C=tan(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/tanf b/tests/10optimizer_bytecode/tanf new file mode 100644 index 0000000..1fa4e1f --- /dev/null +++ b/tests/10optimizer_bytecode/tanf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=tan(1.1)+x +C=tanf(1.1)+x diff --git a/tests/10optimizer_bytecode/tanf_deg b/tests/10optimizer_bytecode/tanf_deg new file mode 100644 index 0000000..79286d7 --- /dev/null +++ b/tests/10optimizer_bytecode/tanf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=tan(1.1)+x +C=tanf(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/tanh b/tests/10optimizer_bytecode/tanh new file mode 100644 index 0000000..6de5606 --- /dev/null +++ b/tests/10optimizer_bytecode/tanh @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=tanh(1.1)+x +C=tanh(1.1)+x diff --git a/tests/10optimizer_bytecode/tanh_deg b/tests/10optimizer_bytecode/tanh_deg new file mode 100644 index 0000000..5eef89f --- /dev/null +++ b/tests/10optimizer_bytecode/tanh_deg @@ -0,0 +1,6 @@ +DEG=true +T=d +V=x +R=0,1,1 +F=tanh(1.1)+x +C=tanh(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/tanhf b/tests/10optimizer_bytecode/tanhf new file mode 100644 index 0000000..56a3b55 --- /dev/null +++ b/tests/10optimizer_bytecode/tanhf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=tanh(1.1)+x +C=tanhf(1.1)+x diff --git a/tests/10optimizer_bytecode/tanhf_deg b/tests/10optimizer_bytecode/tanhf_deg new file mode 100644 index 0000000..411b05e --- /dev/null +++ b/tests/10optimizer_bytecode/tanhf_deg @@ -0,0 +1,6 @@ +DEG=true +T=f +V=x +R=0,1,1 +F=tanh(1.1)+x +C=tanhf(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/tanhl b/tests/10optimizer_bytecode/tanhl new file mode 100644 index 0000000..b610c1b --- /dev/null +++ b/tests/10optimizer_bytecode/tanhl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=tanh(1.1)+x +C=tanhl(1.1)+x diff --git a/tests/10optimizer_bytecode/tanhl_deg b/tests/10optimizer_bytecode/tanhl_deg new file mode 100644 index 0000000..c3eda10 --- /dev/null +++ b/tests/10optimizer_bytecode/tanhl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=tanh(1.1)+x +C=tanhl(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/tanhm b/tests/10optimizer_bytecode/tanhm new file mode 100644 index 0000000..29ce495 --- /dev/null +++ b/tests/10optimizer_bytecode/tanhm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=tanh(1.1)+x +C=MpfrFloat::tanh(1.1)+x diff --git a/tests/10optimizer_bytecode/tanhm_deg b/tests/10optimizer_bytecode/tanhm_deg new file mode 100644 index 0000000..7629e56 --- /dev/null +++ b/tests/10optimizer_bytecode/tanhm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=tanh(1.1)+x +C=MpfrFloat::tanh(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/tanl b/tests/10optimizer_bytecode/tanl new file mode 100644 index 0000000..3535d9c --- /dev/null +++ b/tests/10optimizer_bytecode/tanl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=tan(1.1)+x +C=tanl(1.1)+x diff --git a/tests/10optimizer_bytecode/tanl_deg b/tests/10optimizer_bytecode/tanl_deg new file mode 100644 index 0000000..efcff18 --- /dev/null +++ b/tests/10optimizer_bytecode/tanl_deg @@ -0,0 +1,6 @@ +DEG=true +T=ld +V=x +R=0,1,1 +F=tan(1.1)+x +C=tanl(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/tanm b/tests/10optimizer_bytecode/tanm new file mode 100644 index 0000000..27664e9 --- /dev/null +++ b/tests/10optimizer_bytecode/tanm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=tan(1.1)+x +C=MpfrFloat::tan(1.1)+x diff --git a/tests/10optimizer_bytecode/tanm_deg b/tests/10optimizer_bytecode/tanm_deg new file mode 100644 index 0000000..acdb8fe --- /dev/null +++ b/tests/10optimizer_bytecode/tanm_deg @@ -0,0 +1,6 @@ +DEG=true +T=mf +V=x +R=0,1,1 +F=tan(1.1)+x +C=MpfrFloat::tan(d2r(1.1))+x diff --git a/tests/10optimizer_bytecode/trunc b/tests/10optimizer_bytecode/trunc new file mode 100644 index 0000000..34a27fc --- /dev/null +++ b/tests/10optimizer_bytecode/trunc @@ -0,0 +1,5 @@ +T=d +V=x +R=0,1,1 +F=trunc(1.1)+x +C=1+x diff --git a/tests/10optimizer_bytecode/truncf b/tests/10optimizer_bytecode/truncf new file mode 100644 index 0000000..4e5b281 --- /dev/null +++ b/tests/10optimizer_bytecode/truncf @@ -0,0 +1,5 @@ +T=f +V=x +R=0,1,1 +F=trunc(1.1)+x +C=1+x diff --git a/tests/10optimizer_bytecode/truncl b/tests/10optimizer_bytecode/truncl new file mode 100644 index 0000000..aa508f2 --- /dev/null +++ b/tests/10optimizer_bytecode/truncl @@ -0,0 +1,5 @@ +T=ld +V=x +R=0,1,1 +F=trunc(1.1)+x +C=1+x diff --git a/tests/10optimizer_bytecode/truncm b/tests/10optimizer_bytecode/truncm new file mode 100644 index 0000000..8cbe493 --- /dev/null +++ b/tests/10optimizer_bytecode/truncm @@ -0,0 +1,5 @@ +T=mf +V=x +R=0,1,1 +F=trunc(1.1)+x +C=1+x diff --git a/tests/10optimizer_bytecode/xaddnot b/tests/10optimizer_bytecode/xaddnot new file mode 100644 index 0000000..07315cd --- /dev/null +++ b/tests/10optimizer_bytecode/xaddnot @@ -0,0 +1,5 @@ +T=d f ld li gi +V=x +R=-5,5,1 +F=!(x+4) +C=fp_not(x+4) diff --git a/tests/10optimizer_bytecode/xaddnotnot b/tests/10optimizer_bytecode/xaddnotnot new file mode 100644 index 0000000..d1aafa7 --- /dev/null +++ b/tests/10optimizer_bytecode/xaddnotnot @@ -0,0 +1,5 @@ +T=d f ld li gi +V=x +R=-5,5,1 +F=!!(x+4) +C=fp_notNot(x+4) diff --git a/tests/10optimizer_bytecode/xmulrad b/tests/10optimizer_bytecode/xmulrad new file mode 100644 index 0000000..2096c03 --- /dev/null +++ b/tests/10optimizer_bytecode/xmulrad @@ -0,0 +1,6 @@ +DEG=1 +T=d f ld mf +V=x +R=-2,2,0.8 +F=cos(x*5) +C=fp_cos(d2r(x+x+x+x+x)) diff --git a/tests/10optimizer_bytecode/xmulsinhneg b/tests/10optimizer_bytecode/xmulsinhneg new file mode 100644 index 0000000..b773ee3 --- /dev/null +++ b/tests/10optimizer_bytecode/xmulsinhneg @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=-sinh(x*5) +C=-fp_sinh(x*5) diff --git a/tests/10optimizer_bytecode/xmulsinneg b/tests/10optimizer_bytecode/xmulsinneg new file mode 100644 index 0000000..eb0c4a3 --- /dev/null +++ b/tests/10optimizer_bytecode/xmulsinneg @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=-sin(x*5) +C=-fp_sin(x*5) diff --git a/tests/10optimizer_bytecode/xmultanhneg b/tests/10optimizer_bytecode/xmultanhneg new file mode 100644 index 0000000..ae89862 --- /dev/null +++ b/tests/10optimizer_bytecode/xmultanhneg @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=-tanh(x*5) +C=-fp_tanh(x*5) diff --git a/tests/10optimizer_bytecode/xmultanneg b/tests/10optimizer_bytecode/xmultanneg new file mode 100644 index 0000000..2c6ff53 --- /dev/null +++ b/tests/10optimizer_bytecode/xmultanneg @@ -0,0 +1,5 @@ +T=d f +V=x +R=-0.7, 0.7, 0.28 +F=-tan(x*5) +C=-fp_tan(x*5) diff --git a/tests/10optimizer_bytecode/xsqryfsqrhypot b/tests/10optimizer_bytecode/xsqryfsqrhypot new file mode 100644 index 0000000..147be24 --- /dev/null +++ b/tests/10optimizer_bytecode/xsqryfsqrhypot @@ -0,0 +1,5 @@ +T=d f ld +V=x +R=0.5,3,0.7 +F=sqrt(log(x)^2+log2(x)^2) +C=fp_hypot(fp_log(x),fp_log2(x)) diff --git a/tests/10optimizer_bytecode/xsqrysqrhypot b/tests/10optimizer_bytecode/xsqrysqrhypot new file mode 100644 index 0000000..1c29296 --- /dev/null +++ b/tests/10optimizer_bytecode/xsqrysqrhypot @@ -0,0 +1,5 @@ +T=d f ld +V=x,y +R=0.5,3,0.7 +F=sqrt(log(x)^2+y*y) +C=fp_hypot(fp_log(x),y) diff --git a/tests/10optimizer_bytecode/xxdup b/tests/10optimizer_bytecode/xxdup new file mode 100644 index 0000000..d8bc9a8 --- /dev/null +++ b/tests/10optimizer_bytecode/xxdup @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x +R=-1,1,1 +F=sub(x,x) +C=x-x diff --git a/tests/10optimizer_bytecode/xxfdup b/tests/10optimizer_bytecode/xxfdup new file mode 100644 index 0000000..ea61c34 --- /dev/null +++ b/tests/10optimizer_bytecode/xxfdup @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1,1,1 +F=sub(sin(x),sin(x)) +C=x-x diff --git a/tests/10optimizer_bytecode/xxsqrdup b/tests/10optimizer_bytecode/xxsqrdup new file mode 100644 index 0000000..52b6f10 --- /dev/null +++ b/tests/10optimizer_bytecode/xxsqrdup @@ -0,0 +1,5 @@ +T=d f li ld mf gi +V=x,y +R=-1,1,1 +F=y*abs(x)*abs(x) +C=y*fp_abs(x)*fp_abs(x) diff --git a/tests/10optimizer_bytecode/ypowxpow b/tests/10optimizer_bytecode/ypowxpow new file mode 100644 index 0000000..58dced8 --- /dev/null +++ b/tests/10optimizer_bytecode/ypowxpow @@ -0,0 +1,6 @@ +# y [!IsIntegerConst(y)] cPow x [IsIntegerConst(x)] cPow +T=d +V=x +R=0,10,0.01 +F=(x^38.5)^5 +C=fp_pow(fp_pow(x,38.5),5) diff --git a/tests/11optimizer_constaddmul/1 b/tests/11optimizer_constaddmul/1 new file mode 100644 index 0000000..db0fbc1 --- /dev/null +++ b/tests/11optimizer_constaddmul/1 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-1,1,2 +F=(1/a)*5 +C=(1/a)*5 diff --git a/tests/11optimizer_constaddmul/10 b/tests/11optimizer_constaddmul/10 new file mode 100644 index 0000000..46bbc16 --- /dev/null +++ b/tests/11optimizer_constaddmul/10 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=abs(b)*(5/a) +C=fp_abs(b)*(5/a) diff --git a/tests/11optimizer_constaddmul/11 b/tests/11optimizer_constaddmul/11 new file mode 100644 index 0000000..f823c36 --- /dev/null +++ b/tests/11optimizer_constaddmul/11 @@ -0,0 +1,6 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=abs(b)/(50/a) +C=fp_abs(b)/(50/a) +# Note: Using 50 instead of 5 to prevent division-by-zero in integer test diff --git a/tests/11optimizer_constaddmul/12 b/tests/11optimizer_constaddmul/12 new file mode 100644 index 0000000..0dbd6c6 --- /dev/null +++ b/tests/11optimizer_constaddmul/12 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-15,15,2 +F=(-a)+5 +C=(-a)+5 diff --git a/tests/11optimizer_constaddmul/13 b/tests/11optimizer_constaddmul/13 new file mode 100644 index 0000000..6c5447a --- /dev/null +++ b/tests/11optimizer_constaddmul/13 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=5+(a*b) +C=5+(a*b) diff --git a/tests/11optimizer_constaddmul/14 b/tests/11optimizer_constaddmul/14 new file mode 100644 index 0000000..9a26fdb --- /dev/null +++ b/tests/11optimizer_constaddmul/14 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=5-(a*b) +C=5-(a*b) diff --git a/tests/11optimizer_constaddmul/15 b/tests/11optimizer_constaddmul/15 new file mode 100644 index 0000000..23f5d90 --- /dev/null +++ b/tests/11optimizer_constaddmul/15 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(a+5)+abs(b) +C=(a+5)+fp_abs(b) diff --git a/tests/11optimizer_constaddmul/16 b/tests/11optimizer_constaddmul/16 new file mode 100644 index 0000000..a60c1df --- /dev/null +++ b/tests/11optimizer_constaddmul/16 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(a+5)-abs(b) +C=(a+5)-fp_abs(b) diff --git a/tests/11optimizer_constaddmul/17 b/tests/11optimizer_constaddmul/17 new file mode 100644 index 0000000..8e8a303 --- /dev/null +++ b/tests/11optimizer_constaddmul/17 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(-a)+abs(b) +C=(-a)+fp_abs(b) diff --git a/tests/11optimizer_constaddmul/18 b/tests/11optimizer_constaddmul/18 new file mode 100644 index 0000000..99b6ab5 --- /dev/null +++ b/tests/11optimizer_constaddmul/18 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(-a)-abs(b) +C=(-a)-fp_abs(b) diff --git a/tests/11optimizer_constaddmul/19 b/tests/11optimizer_constaddmul/19 new file mode 100644 index 0000000..d8db0a6 --- /dev/null +++ b/tests/11optimizer_constaddmul/19 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=b+(abs(a)+5) +C=b+(fp_abs(a)+5) diff --git a/tests/11optimizer_constaddmul/2 b/tests/11optimizer_constaddmul/2 new file mode 100644 index 0000000..8538f51 --- /dev/null +++ b/tests/11optimizer_constaddmul/2 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-1,1,2 +F=5*a +C=5*a diff --git a/tests/11optimizer_constaddmul/20 b/tests/11optimizer_constaddmul/20 new file mode 100644 index 0000000..f5cfb11 --- /dev/null +++ b/tests/11optimizer_constaddmul/20 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=b-(abs(a)+5) +C=b-(fp_abs(a)+5) diff --git a/tests/11optimizer_constaddmul/21 b/tests/11optimizer_constaddmul/21 new file mode 100644 index 0000000..c577909 --- /dev/null +++ b/tests/11optimizer_constaddmul/21 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=abs(b)+(5-a) +C=fp_abs(b)+(5-a) diff --git a/tests/11optimizer_constaddmul/22 b/tests/11optimizer_constaddmul/22 new file mode 100644 index 0000000..9517e8d --- /dev/null +++ b/tests/11optimizer_constaddmul/22 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=abs(b)-(5-a) +C=fp_abs(b)-(5-a) diff --git a/tests/11optimizer_constaddmul/23 b/tests/11optimizer_constaddmul/23 new file mode 100644 index 0000000..e113663 --- /dev/null +++ b/tests/11optimizer_constaddmul/23 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((1/ abs(b))*b)/a +C=((1/fp_abs(b))*b)/a diff --git a/tests/11optimizer_constaddmul/24 b/tests/11optimizer_constaddmul/24 new file mode 100644 index 0000000..7ba8424 --- /dev/null +++ b/tests/11optimizer_constaddmul/24 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((1/ abs(b))*5)/a +C=((1/fp_abs(b))*5)/a diff --git a/tests/11optimizer_constaddmul/25 b/tests/11optimizer_constaddmul/25 new file mode 100644 index 0000000..e9d2e79 --- /dev/null +++ b/tests/11optimizer_constaddmul/25 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((1/ abs(b))*5)*a +C=((1/fp_abs(b))*5)*a diff --git a/tests/11optimizer_constaddmul/26 b/tests/11optimizer_constaddmul/26 new file mode 100644 index 0000000..148590f --- /dev/null +++ b/tests/11optimizer_constaddmul/26 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=( abs(a)/b)/a +C=(fp_abs(a)/b)/a diff --git a/tests/11optimizer_constaddmul/27 b/tests/11optimizer_constaddmul/27 new file mode 100644 index 0000000..16cb5cb --- /dev/null +++ b/tests/11optimizer_constaddmul/27 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=( abs(a)/b)*a +C=(fp_abs(a)/b)*a diff --git a/tests/11optimizer_constaddmul/28 b/tests/11optimizer_constaddmul/28 new file mode 100644 index 0000000..753291b --- /dev/null +++ b/tests/11optimizer_constaddmul/28 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((-a)/b)*5 +C=((-a)/b)*5 diff --git a/tests/11optimizer_constaddmul/29 b/tests/11optimizer_constaddmul/29 new file mode 100644 index 0000000..e1e1b4c --- /dev/null +++ b/tests/11optimizer_constaddmul/29 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(5/b)*a +C=(5/b)*a diff --git a/tests/11optimizer_constaddmul/3 b/tests/11optimizer_constaddmul/3 new file mode 100644 index 0000000..46bb26c --- /dev/null +++ b/tests/11optimizer_constaddmul/3 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-1,1,2 +F=5/a +C=5/a diff --git a/tests/11optimizer_constaddmul/30 b/tests/11optimizer_constaddmul/30 new file mode 100644 index 0000000..dcd2efd --- /dev/null +++ b/tests/11optimizer_constaddmul/30 @@ -0,0 +1,5 @@ +T=d li cd +V=b +R=-15,15,2 +F=(7/b)*5 +C=(7/b)*5 diff --git a/tests/11optimizer_constaddmul/31 b/tests/11optimizer_constaddmul/31 new file mode 100644 index 0000000..d7d42eb --- /dev/null +++ b/tests/11optimizer_constaddmul/31 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=b*(7/-a) +C=b*(7/-a) diff --git a/tests/11optimizer_constaddmul/32 b/tests/11optimizer_constaddmul/32 new file mode 100644 index 0000000..8cf5042 --- /dev/null +++ b/tests/11optimizer_constaddmul/32 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(5-b)-a +C=(5-b)-a diff --git a/tests/11optimizer_constaddmul/33 b/tests/11optimizer_constaddmul/33 new file mode 100644 index 0000000..ffc2afd --- /dev/null +++ b/tests/11optimizer_constaddmul/33 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(5-b)+a +C=(5-b)+a diff --git a/tests/11optimizer_constaddmul/34 b/tests/11optimizer_constaddmul/34 new file mode 100644 index 0000000..5f07066 --- /dev/null +++ b/tests/11optimizer_constaddmul/34 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((a+7)-b)+5 +C=((a+7)-b)+5 diff --git a/tests/11optimizer_constaddmul/35 b/tests/11optimizer_constaddmul/35 new file mode 100644 index 0000000..11e2dc1 --- /dev/null +++ b/tests/11optimizer_constaddmul/35 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((-a)-b)+5 +C=((-a)-b)+5 diff --git a/tests/11optimizer_constaddmul/36 b/tests/11optimizer_constaddmul/36 new file mode 100644 index 0000000..29c8dcd --- /dev/null +++ b/tests/11optimizer_constaddmul/36 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-15,15,2 +F=(7-abs(a))+5 +C=(7-fp_abs(a))+5 diff --git a/tests/11optimizer_constaddmul/37 b/tests/11optimizer_constaddmul/37 new file mode 100644 index 0000000..647049b --- /dev/null +++ b/tests/11optimizer_constaddmul/37 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((7-b)+a)+5 +C=((7-b)+a)+5 diff --git a/tests/11optimizer_constaddmul/38 b/tests/11optimizer_constaddmul/38 new file mode 100644 index 0000000..d32d2b7 --- /dev/null +++ b/tests/11optimizer_constaddmul/38 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=((5*b+abs(a))<0)*1 + ((abs(b))<0)*2 +C=fp_less((5*b+fp_abs(a)),0)*1 + fp_less((fp_abs(b)),0)*2 diff --git a/tests/11optimizer_constaddmul/39 b/tests/11optimizer_constaddmul/39 new file mode 100644 index 0000000..2a98e56 --- /dev/null +++ b/tests/11optimizer_constaddmul/39 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-15,15,2 +F=(a+7)*5 +C=(a+7)*5 diff --git a/tests/11optimizer_constaddmul/4 b/tests/11optimizer_constaddmul/4 new file mode 100644 index 0000000..2ce93a1 --- /dev/null +++ b/tests/11optimizer_constaddmul/4 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-1,1,2 +F=(a*5)*b +C=(a*5)*b diff --git a/tests/11optimizer_constaddmul/40 b/tests/11optimizer_constaddmul/40 new file mode 100644 index 0000000..1fd4411 --- /dev/null +++ b/tests/11optimizer_constaddmul/40 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(b+(a*7))*5 +C=(b+(a*7))*5 diff --git a/tests/11optimizer_constaddmul/41 b/tests/11optimizer_constaddmul/41 new file mode 100644 index 0000000..7c5efd0 --- /dev/null +++ b/tests/11optimizer_constaddmul/41 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-15,15,2 +F=(b-(a*7))*5 +C=(b-(a*7))*5 diff --git a/tests/11optimizer_constaddmul/42 b/tests/11optimizer_constaddmul/42 new file mode 100644 index 0000000..6d226b6 --- /dev/null +++ b/tests/11optimizer_constaddmul/42 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-15,15,2 +F=(a+7)+5 +C=(a+7)+5 diff --git a/tests/11optimizer_constaddmul/43 b/tests/11optimizer_constaddmul/43 new file mode 100644 index 0000000..8a1e85f --- /dev/null +++ b/tests/11optimizer_constaddmul/43 @@ -0,0 +1,5 @@ +T=d li cd +V=a +R=-15,15,2 +F=(a*7)*5 +C=(a*7)*5 diff --git a/tests/11optimizer_constaddmul/5 b/tests/11optimizer_constaddmul/5 new file mode 100644 index 0000000..0c9506c --- /dev/null +++ b/tests/11optimizer_constaddmul/5 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-1,1,2 +F=(a*5)/b +C=(a*5)/b diff --git a/tests/11optimizer_constaddmul/6 b/tests/11optimizer_constaddmul/6 new file mode 100644 index 0000000..a9597cc --- /dev/null +++ b/tests/11optimizer_constaddmul/6 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-1,1,2 +F=(1/a)*b +C=(1/a)*b diff --git a/tests/11optimizer_constaddmul/7 b/tests/11optimizer_constaddmul/7 new file mode 100644 index 0000000..27aa0bd --- /dev/null +++ b/tests/11optimizer_constaddmul/7 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-1,1,2 +F=(1/a)/b +C=(1/a)/b diff --git a/tests/11optimizer_constaddmul/8 b/tests/11optimizer_constaddmul/8 new file mode 100644 index 0000000..4c666b5 --- /dev/null +++ b/tests/11optimizer_constaddmul/8 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-1,1,2 +F=abs(a)*(abs(b)*5) +C=fp_abs(a)*(fp_abs(b)*5) diff --git a/tests/11optimizer_constaddmul/9 b/tests/11optimizer_constaddmul/9 new file mode 100644 index 0000000..1b7172f --- /dev/null +++ b/tests/11optimizer_constaddmul/9 @@ -0,0 +1,5 @@ +T=d li cd +V=a,b +R=-1,1,2 +F=abs(a)/(abs(b)*5) +C=fp_abs(a)/(fp_abs(b)*5) diff --git a/tests/11optimizer_constaddmul/README b/tests/11optimizer_constaddmul/README new file mode 100644 index 0000000..33accf3 --- /dev/null +++ b/tests/11optimizer_constaddmul/README @@ -0,0 +1,69 @@ +# Test topics: +# +# fparser.cc, CompileMul: +# +# ... cInv 5 cMul --> ... 5 cRDiv TEST 1 +# 5 ... cMul --> ... 5 cMul TEST 2 +# 5 ... cDiv --> cInv ... 5 cMul TEST 3 +# ::: 5 cMul ... cMul --> ::: ... cMul 5 cMul TEST 4 +# ::: 5 cMul ... cDiv --> ::: ... cDiv 5 cMul TEST 5 +# ::: cInv ... cMul --> ::: ... cRDiv TEST 6 +# ::: cInv ... cDiv --> ::: ... cMul cInv TEST 7 +# ::: ... 5 cMul cMul --> ::: ... cMul 5 cMul TEST 8 +# ::: ... 5 cMul cDiv --> ::: ... cDiv .2 cMul TEST 9 +# ::: ... 5 cRDiv cMul --> ::: ... cDiv 5 cMul TEST 10 +# ::: ... 5 cRDiv cDiv --> ::: ... cDiv .2 cMul TEST 11 +# +# fparser.cc, CompileAdd: +# +# ... cNeg 5 cAdd --> ... 5 cRSub TEST 12 +# 5 ... cAdd --> ... 5 cAdd TEST 13 +# 5 ... cSub --> ... cNeg 5 cAdd TEST 14 +# ::: 5 cAdd ... cAdd --> ::: ... cAdd 5 cAdd TEST 15 +# ::: 5 cAdd ... cSub --> ::: ... cSub 5 cAdd TEST 16 +# ::: cNeg ... cAdd --> ::: ... cRSub TEST 17 +# ::: cNeg ... cSub --> ::: ... cAdd cNeg TEST 18 +# ::: ... 5 cAdd cAdd --> ::: ... cAdd 5 cAdd TEST 19 +# ::: ... 5 cAdd cSub --> ::: ... cSub -5 cAdd TEST 20 +# ::: ... 5 cRSub cAdd --> ::: ... cSub 5 cAdd TEST 21 +# ::: ... 5 cRSub cSub --> ::: ... cAdd -5 cAdd TEST 22 +# +# bytecoderules (a,b = variables, P=non-negative opcode): +# +# b cRDiv a cDiv --> a cMul b cRDiv TEST 23 +# 5 cRDiv a cDiv --> a cMul 5 cRDiv TEST 24 +# 5 cRDiv a cMul --> a 5 cMul cRDiv TEST 25 +# b cDiv a cDiv --> b a cMul cDiv TEST 26 +# b cDiv a cMul --> a cMul b cDiv TEST 27 +# 7 b cDiv 5 cMul --> 35 b cDiv Cannot achieve test case +# 7 cMul b cDiv 5 cMul --> 35 cMul b cDiv Cannot achieve test case +# cNeg b cDiv 5 cMul --> -5 cMul b cDiv TEST 28 +# cRDiv a cMul --> a cMul cRDiv TEST 29 (possibly duplicate of 25) +# 7 cRDiv 5 cMul --> 35 cRDiv TEST 30 +# 7 cMul cRDiv 5 cMul --> 35 cMul cRDiv Cannot achieve test case +# cNeg cRDiv 5 cMul --> -5 cMul cRDiv TEST 31 +# +# 5 cRSub a cSub --> a cAdd 5 cRSub TEST 32 +# 5 cRSub a cAdd --> a 5 cAdd cRSub TEST 33 +# 7 b cSub 5 cAdd --> 12 b cSub Cannot achieve test case +# 7 cAdd b cSub 5 cAdd --> 12 cAdd b cSub TEST 34 +# cNeg b cSub 5 cAdd --> -5 cAdd b csub TEST 35 +# cRSub a cAdd --> a cAdd cRSub TEST 32 (duplicate) +# cRSub a cSub --> a cSub cRSub TEST 33 (duplicate) +# 7 cRSub 5 cAdd --> 12 cRSub TEST 36 +# 7 cAdd cRSub 5 cAdd --> 12 cAdd cRSub TEST 37 +# cNeg cRSub 5 cAdd --> -5 cAdd cRSub Cannot achieve test case +# P 0 cLess --> P 0 cMul TEST 38 +# +# 7 cAdd 5 cMul --> 5 cMul 35 cAdd TEST 39 +# a 7 cMul cAdd 5 cMul --> 5 cMul a 35 cMul cAdd TEST 40 +# a 7 cMul cSub 5 cMul --> 5 cMul a 35 cMul cSub TEST 41 +# +# 7 cAdd 5 cAdd --> 12 cAdd TEST 42 +# 7 cMul 5 cMul --> 35 cMul TEST 43 +# +# Tests are done for a floating point type (double) +# and an integer type (long int). +# Some of these optimizations are not done for integers, and +# testing will verify that int mathematics is not broken. +# diff --git a/tests/20optimizer_optimizations/abscos b/tests/20optimizer_optimizations/abscos new file mode 100644 index 0000000..f02ef5e --- /dev/null +++ b/tests/20optimizer_optimizations/abscos @@ -0,0 +1,9 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=cos(sqrt(cbrt(x^6))) + sqrt(cbrt(x^6)) +C=fp_cos(fp_abs(x)) + fp_abs(x) + +# sqrt(cbrt(x^6)) produces abs(x) through fpoptimizer. +# We cannot use abs(x) directly, because +# then bytecode optimizer would take it. diff --git a/tests/20optimizer_optimizations/abscosh b/tests/20optimizer_optimizations/abscosh new file mode 100644 index 0000000..6cf480b --- /dev/null +++ b/tests/20optimizer_optimizations/abscosh @@ -0,0 +1,9 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=cosh(sqrt(cbrt(x^6))) + sqrt(cbrt(x^6)) +C=fp_cosh(fp_abs(x)) + fp_abs(x) + +# sqrt(cbrt(x^6)) produces abs(x) through fpoptimizer. +# We cannot use abs(x) directly, because +# then bytecode optimizer would take it. diff --git a/tests/20optimizer_optimizations/abseq0 b/tests/20optimizer_optimizations/abseq0 new file mode 100644 index 0000000..bec8155 --- /dev/null +++ b/tests/20optimizer_optimizations/abseq0 @@ -0,0 +1,5 @@ +T=d li cd +V=x +R=0,1,1 +F=(abs(x)=if(1,0,1)) + (if(1,0,1)=abs(x)) +C=fp_equal(fp_abs(x),0) + fp_equal(0,fp_abs(x)) diff --git a/tests/20optimizer_optimizations/absneq0 b/tests/20optimizer_optimizations/absneq0 new file mode 100644 index 0000000..bec8155 --- /dev/null +++ b/tests/20optimizer_optimizations/absneq0 @@ -0,0 +1,5 @@ +T=d li cd +V=x +R=0,1,1 +F=(abs(x)=if(1,0,1)) + (if(1,0,1)=abs(x)) +C=fp_equal(fp_abs(x),0) + fp_equal(0,fp_abs(x)) diff --git a/tests/20optimizer_optimizations/absnzge b/tests/20optimizer_optimizations/absnzge new file mode 100644 index 0000000..39b377f --- /dev/null +++ b/tests/20optimizer_optimizations/absnzge @@ -0,0 +1,5 @@ +T=d li gi cd +V=x +R=-5,5,1 +F=sub(abs(x) >= if(1,4,0), abs(x) >= (if(1,1,0)-1)) +C=userDefFuncSub({fp_greaterOrEq(fp_abs(x),4), fp_greaterOrEq(fp_abs(x),0)}) diff --git a/tests/20optimizer_optimizations/absnzlt b/tests/20optimizer_optimizations/absnzlt new file mode 100644 index 0000000..f7e32e5 --- /dev/null +++ b/tests/20optimizer_optimizations/absnzlt @@ -0,0 +1,5 @@ +T=d li gi cd +V=x +R=-5,5,1 +F=sub(abs(x) < if(1,4,0), abs(x) < (if(1,1,0)-1)) +C=userDefFuncSub({fp_less(fp_abs(x),4), fp_less(fp_abs(x),0)}) diff --git a/tests/20optimizer_optimizations/acoscos b/tests/20optimizer_optimizations/acoscos new file mode 100644 index 0000000..cf499d7 --- /dev/null +++ b/tests/20optimizer_optimizations/acoscos @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=-1,1,0.1 +F=cos(acos(x)) +C=fp_cos(fp_acos(x)) diff --git a/tests/20optimizer_optimizations/acoshsinh b/tests/20optimizer_optimizations/acoshsinh new file mode 100644 index 0000000..0258ae4 --- /dev/null +++ b/tests/20optimizer_optimizations/acoshsinh @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=1.7, 3.7, 0.28 +F=sinh(if(1,acosh(x),0)) +C=fp_sinh(fp_acosh(x)) diff --git a/tests/20optimizer_optimizations/addconstmul b/tests/20optimizer_optimizations/addconstmul new file mode 100644 index 0000000..a9932f3 --- /dev/null +++ b/tests/20optimizer_optimizations/addconstmul @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=x,y +R=-3,3,2 +F=5*(if(1,4,0)+x+y) +C=5*(4+x+y) diff --git a/tests/20optimizer_optimizations/addlog b/tests/20optimizer_optimizations/addlog new file mode 100644 index 0000000..86eb0b6 --- /dev/null +++ b/tests/20optimizer_optimizations/addlog @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x,y +R=0.25, 1, 0.25 +F=log(x)+log(y) +C=fp_log(x)+fp_log(y) + +# Expected result: log(x*y) diff --git a/tests/20optimizer_optimizations/addmulconstmul b/tests/20optimizer_optimizations/addmulconstmul new file mode 100644 index 0000000..299c000 --- /dev/null +++ b/tests/20optimizer_optimizations/addmulconstmul @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=x,y +R=-3,3,2 +F=5*(if(1,4,0)*y+x) +C=5*(4*y+x) diff --git a/tests/20optimizer_optimizations/addnegmulneg b/tests/20optimizer_optimizations/addnegmulneg new file mode 100644 index 0000000..18f8885 --- /dev/null +++ b/tests/20optimizer_optimizations/addnegmulneg @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y +R=-3,3,2 +F=-5 + (if(1,5,0)*x*y) +C=-5 + (5*x*y) + +# Expected result: (1 - x*y) * -5 diff --git a/tests/20optimizer_optimizations/addnegmulpos b/tests/20optimizer_optimizations/addnegmulpos new file mode 100644 index 0000000..0336867 --- /dev/null +++ b/tests/20optimizer_optimizations/addnegmulpos @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y +R=-3,3,2 +F=(if(1,-5,0)*y) + (if(1,5,0)*x) +C=-5*y + (5*x) + +# Expected result: (x-y) * 5 diff --git a/tests/20optimizer_optimizations/addsin2cos2 b/tests/20optimizer_optimizations/addsin2cos2 new file mode 100644 index 0000000..1fc07fb --- /dev/null +++ b/tests/20optimizer_optimizations/addsin2cos2 @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,0.5 +F=sin(x)^2 + cos(x)^2 +C=fp_pow(fp_sin(x),2) + fp_pow(fp_cos(x),2) + +# Expected optimization: 1 diff --git a/tests/20optimizer_optimizations/asinhcosh b/tests/20optimizer_optimizations/asinhcosh new file mode 100644 index 0000000..f2506d0 --- /dev/null +++ b/tests/20optimizer_optimizations/asinhcosh @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=-0.7, 0.7, 0.28 +F=cosh(if(1,asinh(x),0)) +C=fp_cosh(fp_asinh(x)) diff --git a/tests/20optimizer_optimizations/asinsin b/tests/20optimizer_optimizations/asinsin new file mode 100644 index 0000000..9b13485 --- /dev/null +++ b/tests/20optimizer_optimizations/asinsin @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x +R=-1,1,0.1 +F=sin(asin(x)) +C=fp_sin(fp_asin(x)) diff --git a/tests/20optimizer_optimizations/cmpeq_add_imm b/tests/20optimizer_optimizations/cmpeq_add_imm new file mode 100644 index 0000000..6d4f9cd --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_add_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4+y) = 6) +C=fp_equal(x+4+y, 6) diff --git a/tests/20optimizer_optimizations/cmpeq_add_reduce b/tests/20optimizer_optimizations/cmpeq_add_reduce new file mode 100644 index 0000000..ae303d5 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_add_reduce @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-6,6,1 +F=((((x*5/2)+x*x-2)) = ((x*5/2)+abs(x))) +C=fp_equal(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) diff --git a/tests/20optimizer_optimizations/cmpeq_addadd_imm b/tests/20optimizer_optimizations/cmpeq_addadd_imm new file mode 100644 index 0000000..6f20972 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_addadd_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4) = (y+6)) +C=fp_equal(x+4, y+6) diff --git a/tests/20optimizer_optimizations/cmpeq_minmax b/tests/20optimizer_optimizations/cmpeq_minmax new file mode 100644 index 0000000..88a8342 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_minmax @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x = y,x,y) +C=((fp_equal(x,y)!=0)?x:y) diff --git a/tests/20optimizer_optimizations/cmpeq_minmax_rev b/tests/20optimizer_optimizations/cmpeq_minmax_rev new file mode 100644 index 0000000..45c8b0a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_minmax_rev @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x = y,y,x) +C=((fp_equal(x,y)!=0)?y:x) diff --git a/tests/20optimizer_optimizations/cmpeq_mul_imm_neg b/tests/20optimizer_optimizations/cmpeq_mul_imm_neg new file mode 100644 index 0000000..0018f50 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_mul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4*y) = 6) +C=fp_equal(x*-4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpeq_mul_imm_pos b/tests/20optimizer_optimizations/cmpeq_mul_imm_pos new file mode 100644 index 0000000..b311d85 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_mul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4*y) = 6) +C=fp_equal(x*4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpeq_mulmul_imm_neg b/tests/20optimizer_optimizations/cmpeq_mulmul_imm_neg new file mode 100644 index 0000000..db91e01 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_mulmul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4) = (y+6)) +C=fp_equal(x*-4, y+6) diff --git a/tests/20optimizer_optimizations/cmpeq_mulmul_imm_pos b/tests/20optimizer_optimizations/cmpeq_mulmul_imm_pos new file mode 100644 index 0000000..699672a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_mulmul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4) = (y+6)) +C=fp_equal(x*4, y+6) diff --git a/tests/20optimizer_optimizations/cmpeq_pow_imm_negneg b/tests/20optimizer_optimizations/cmpeq_pow_imm_negneg new file mode 100644 index 0000000..0645414 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_pow_imm_negneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-3) = -0.015625) +C=fp_equal(fp_pow(x,-3), -0.015625) diff --git a/tests/20optimizer_optimizations/cmpeq_pow_imm_negpos b/tests/20optimizer_optimizations/cmpeq_pow_imm_negpos new file mode 100644 index 0000000..a35e0b0 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_pow_imm_negpos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-2) = 0.0625) +C=fp_equal(fp_pow(x,-2), 0.0625) diff --git a/tests/20optimizer_optimizations/cmpeq_pow_imm_posneg b/tests/20optimizer_optimizations/cmpeq_pow_imm_posneg new file mode 100644 index 0000000..deeeb15 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_pow_imm_posneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,3) = -125) +C=fp_equal(x*x*x, -125) diff --git a/tests/20optimizer_optimizations/cmpeq_pow_imm_pospos b/tests/20optimizer_optimizations/cmpeq_pow_imm_pospos new file mode 100644 index 0000000..2273cf1 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_pow_imm_pospos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,2) = 25) +C=fp_equal(x*x, 25) diff --git a/tests/20optimizer_optimizations/cmpeq_pow_imm_pospos_base b/tests/20optimizer_optimizations/cmpeq_pow_imm_pospos_base new file mode 100644 index 0000000..ab80ac4 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_pow_imm_pospos_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(5.0625 = pow(1.5,x)) +C=fp_equal(5.0625, fp_pow(1.5,x)) diff --git a/tests/20optimizer_optimizations/cmpeq_powpow_imm_base b/tests/20optimizer_optimizations/cmpeq_powpow_imm_base new file mode 100644 index 0000000..e95a996 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpeq_powpow_imm_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-6,6,1 +F=(pow(2,x) = pow(-4,y)) +C=fp_equal(fp_pow(2,x), fp_pow(-4,y)) diff --git a/tests/20optimizer_optimizations/cmpge_add_imm b/tests/20optimizer_optimizations/cmpge_add_imm new file mode 100644 index 0000000..bc4852a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_add_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4+y) >= 6) +C=fp_greaterOrEq(x+4+y, 6) diff --git a/tests/20optimizer_optimizations/cmpge_add_reduce b/tests/20optimizer_optimizations/cmpge_add_reduce new file mode 100644 index 0000000..87f392a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_add_reduce @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-6,6,1 +F=((((x*5/2)+x*x-2)) >= ((x*5/2)+abs(x))) +C=fp_greaterOrEq(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) diff --git a/tests/20optimizer_optimizations/cmpge_addadd_imm b/tests/20optimizer_optimizations/cmpge_addadd_imm new file mode 100644 index 0000000..409960f --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_addadd_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4) >= (y+6)) +C=fp_greaterOrEq(x+4, y+6) diff --git a/tests/20optimizer_optimizations/cmpge_minmax b/tests/20optimizer_optimizations/cmpge_minmax new file mode 100644 index 0000000..31fca73 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_minmax @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x >= y,x,y) +C=((fp_greaterOrEq(x,y)!=0)?x:y) diff --git a/tests/20optimizer_optimizations/cmpge_minmax_rev b/tests/20optimizer_optimizations/cmpge_minmax_rev new file mode 100644 index 0000000..525ad01 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_minmax_rev @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x >= y,y,x) +C=((fp_greaterOrEq(x,y)!=0)?y:x) diff --git a/tests/20optimizer_optimizations/cmpge_mul_imm_neg b/tests/20optimizer_optimizations/cmpge_mul_imm_neg new file mode 100644 index 0000000..8cb340b --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_mul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4*y) >= 6) +C=fp_greaterOrEq(x*-4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpge_mul_imm_pos b/tests/20optimizer_optimizations/cmpge_mul_imm_pos new file mode 100644 index 0000000..46877c5 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_mul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4*y) >= 6) +C=fp_greaterOrEq(x*4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpge_mulmul_imm_neg b/tests/20optimizer_optimizations/cmpge_mulmul_imm_neg new file mode 100644 index 0000000..df087ac --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_mulmul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4) >= (y+6)) +C=fp_greaterOrEq(x*-4, y+6) diff --git a/tests/20optimizer_optimizations/cmpge_mulmul_imm_pos b/tests/20optimizer_optimizations/cmpge_mulmul_imm_pos new file mode 100644 index 0000000..5dff6aa --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_mulmul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4) >= (y+6)) +C=fp_greaterOrEq(x*4, y+6) diff --git a/tests/20optimizer_optimizations/cmpge_pow_imm_negneg b/tests/20optimizer_optimizations/cmpge_pow_imm_negneg new file mode 100644 index 0000000..44e384a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_pow_imm_negneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-3) >= -0.015625) +C=fp_greaterOrEq(fp_pow(x,-3), -0.015625) diff --git a/tests/20optimizer_optimizations/cmpge_pow_imm_negpos b/tests/20optimizer_optimizations/cmpge_pow_imm_negpos new file mode 100644 index 0000000..3e89c60 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_pow_imm_negpos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-2) >= 0.0625) +C=fp_greaterOrEq(fp_pow(x,-2), 0.0625) diff --git a/tests/20optimizer_optimizations/cmpge_pow_imm_posneg b/tests/20optimizer_optimizations/cmpge_pow_imm_posneg new file mode 100644 index 0000000..f30858f --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_pow_imm_posneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,3) >= -125) +C=fp_greaterOrEq(x*x*x, -125) diff --git a/tests/20optimizer_optimizations/cmpge_pow_imm_pospos b/tests/20optimizer_optimizations/cmpge_pow_imm_pospos new file mode 100644 index 0000000..dae851e --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_pow_imm_pospos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,2) >= 25) +C=fp_greaterOrEq(x*x, 25) diff --git a/tests/20optimizer_optimizations/cmpge_pow_imm_pospos_base b/tests/20optimizer_optimizations/cmpge_pow_imm_pospos_base new file mode 100644 index 0000000..2031751 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_pow_imm_pospos_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(5.0625 >= pow(1.5,x)) +C=fp_greaterOrEq(5.0625, fp_pow(1.5,x)) diff --git a/tests/20optimizer_optimizations/cmpge_powpow_imm_base b/tests/20optimizer_optimizations/cmpge_powpow_imm_base new file mode 100644 index 0000000..58b62bb --- /dev/null +++ b/tests/20optimizer_optimizations/cmpge_powpow_imm_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-6,6,1 +F=(pow(2,x) >= pow(-4,y)) +C=fp_greaterOrEq(fp_pow(2,x), fp_pow(-4,y)) diff --git a/tests/20optimizer_optimizations/cmpgt_add_imm b/tests/20optimizer_optimizations/cmpgt_add_imm new file mode 100644 index 0000000..86aa195 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_add_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4+y) > 6) +C=fp_greater(x+4+y, 6) diff --git a/tests/20optimizer_optimizations/cmpgt_add_reduce b/tests/20optimizer_optimizations/cmpgt_add_reduce new file mode 100644 index 0000000..370d9e3 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_add_reduce @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-6,6,1 +F=((((x*5/2)+x*x-2)) > ((x*5/2)+abs(x))) +C=fp_greater(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) diff --git a/tests/20optimizer_optimizations/cmpgt_addadd_imm b/tests/20optimizer_optimizations/cmpgt_addadd_imm new file mode 100644 index 0000000..83c40c8 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_addadd_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4) > (y+6)) +C=fp_greater(x+4, y+6) diff --git a/tests/20optimizer_optimizations/cmpgt_minmax b/tests/20optimizer_optimizations/cmpgt_minmax new file mode 100644 index 0000000..4f4b23b --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_minmax @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x > y,x,y) +C=((fp_greater(x,y)!=0)?x:y) diff --git a/tests/20optimizer_optimizations/cmpgt_minmax_rev b/tests/20optimizer_optimizations/cmpgt_minmax_rev new file mode 100644 index 0000000..7a06d99 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_minmax_rev @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x > y,y,x) +C=((fp_greater(x,y)!=0)?y:x) diff --git a/tests/20optimizer_optimizations/cmpgt_mul_imm_neg b/tests/20optimizer_optimizations/cmpgt_mul_imm_neg new file mode 100644 index 0000000..454d135 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_mul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4*y) > 6) +C=fp_greater(x*-4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpgt_mul_imm_pos b/tests/20optimizer_optimizations/cmpgt_mul_imm_pos new file mode 100644 index 0000000..ca4de8c --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_mul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4*y) > 6) +C=fp_greater(x*4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpgt_mulmul_imm_neg b/tests/20optimizer_optimizations/cmpgt_mulmul_imm_neg new file mode 100644 index 0000000..222274a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_mulmul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4) > (y+6)) +C=fp_greater(x*-4, y+6) diff --git a/tests/20optimizer_optimizations/cmpgt_mulmul_imm_pos b/tests/20optimizer_optimizations/cmpgt_mulmul_imm_pos new file mode 100644 index 0000000..01df9b4 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_mulmul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4) > (y+6)) +C=fp_greater(x*4, y+6) diff --git a/tests/20optimizer_optimizations/cmpgt_pow_imm_negneg b/tests/20optimizer_optimizations/cmpgt_pow_imm_negneg new file mode 100644 index 0000000..1d56fc0 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_pow_imm_negneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-3) > -0.015625) +C=fp_greater(fp_pow(x,-3), -0.015625) diff --git a/tests/20optimizer_optimizations/cmpgt_pow_imm_negpos b/tests/20optimizer_optimizations/cmpgt_pow_imm_negpos new file mode 100644 index 0000000..2fd0f5e --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_pow_imm_negpos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-2) > 0.0625) +C=fp_greater(fp_pow(x,-2), 0.0625) diff --git a/tests/20optimizer_optimizations/cmpgt_pow_imm_posneg b/tests/20optimizer_optimizations/cmpgt_pow_imm_posneg new file mode 100644 index 0000000..c6be28a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_pow_imm_posneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,3) > -125) +C=fp_greater(x*x*x, -125) diff --git a/tests/20optimizer_optimizations/cmpgt_pow_imm_pospos b/tests/20optimizer_optimizations/cmpgt_pow_imm_pospos new file mode 100644 index 0000000..c9668c3 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_pow_imm_pospos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,2) > 25) +C=fp_greater(x*x, 25) diff --git a/tests/20optimizer_optimizations/cmpgt_pow_imm_pospos_base b/tests/20optimizer_optimizations/cmpgt_pow_imm_pospos_base new file mode 100644 index 0000000..9bb28a8 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_pow_imm_pospos_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(5.0625 > pow(1.5,x)) +C=fp_greater(5.0625, fp_pow(1.5,x)) diff --git a/tests/20optimizer_optimizations/cmpgt_powpow_imm_base b/tests/20optimizer_optimizations/cmpgt_powpow_imm_base new file mode 100644 index 0000000..338dd62 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpgt_powpow_imm_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-6,6,1 +F=(pow(2,x) > pow(-4,y)) +C=fp_greater(fp_pow(2,x), fp_pow(-4,y)) diff --git a/tests/20optimizer_optimizations/cmple_add_imm b/tests/20optimizer_optimizations/cmple_add_imm new file mode 100644 index 0000000..4a6746e --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_add_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4+y) <= 6) +C=fp_lessOrEq(x+4+y, 6) diff --git a/tests/20optimizer_optimizations/cmple_add_reduce b/tests/20optimizer_optimizations/cmple_add_reduce new file mode 100644 index 0000000..afbb756 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_add_reduce @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-6,6,1 +F=((((x*5/2)+x*x-2)) <= ((x*5/2)+abs(x))) +C=fp_lessOrEq(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) diff --git a/tests/20optimizer_optimizations/cmple_addadd_imm b/tests/20optimizer_optimizations/cmple_addadd_imm new file mode 100644 index 0000000..90d76b1 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_addadd_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4) <= (y+6)) +C=fp_lessOrEq(x+4, y+6) diff --git a/tests/20optimizer_optimizations/cmple_minmax b/tests/20optimizer_optimizations/cmple_minmax new file mode 100644 index 0000000..96f5736 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_minmax @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x <= y,x,y) +C=((fp_lessOrEq(x,y)!=0)?x:y) diff --git a/tests/20optimizer_optimizations/cmple_minmax_rev b/tests/20optimizer_optimizations/cmple_minmax_rev new file mode 100644 index 0000000..4083728 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_minmax_rev @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x <= y,y,x) +C=((fp_lessOrEq(x,y)!=0)?y:x) diff --git a/tests/20optimizer_optimizations/cmple_mul_imm_neg b/tests/20optimizer_optimizations/cmple_mul_imm_neg new file mode 100644 index 0000000..48dcac1 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_mul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4*y) <= 6) +C=fp_lessOrEq(x*-4*y, 6) diff --git a/tests/20optimizer_optimizations/cmple_mul_imm_pos b/tests/20optimizer_optimizations/cmple_mul_imm_pos new file mode 100644 index 0000000..4e99912 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_mul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4*y) <= 6) +C=fp_lessOrEq(x*4*y, 6) diff --git a/tests/20optimizer_optimizations/cmple_mulmul_imm_neg b/tests/20optimizer_optimizations/cmple_mulmul_imm_neg new file mode 100644 index 0000000..78cf6f1 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_mulmul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4) <= (y+6)) +C=fp_lessOrEq(x*-4, y+6) diff --git a/tests/20optimizer_optimizations/cmple_mulmul_imm_pos b/tests/20optimizer_optimizations/cmple_mulmul_imm_pos new file mode 100644 index 0000000..35e0efd --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_mulmul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4) <= (y+6)) +C=fp_lessOrEq(x*4, y+6) diff --git a/tests/20optimizer_optimizations/cmple_pow_imm_negneg b/tests/20optimizer_optimizations/cmple_pow_imm_negneg new file mode 100644 index 0000000..60f2617 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_pow_imm_negneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-3) <= -0.015625) +C=fp_lessOrEq(fp_pow(x,-3), -0.015625) diff --git a/tests/20optimizer_optimizations/cmple_pow_imm_negpos b/tests/20optimizer_optimizations/cmple_pow_imm_negpos new file mode 100644 index 0000000..9e90c41 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_pow_imm_negpos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-2) <= 0.0625) +C=fp_lessOrEq(fp_pow(x,-2), 0.0625) diff --git a/tests/20optimizer_optimizations/cmple_pow_imm_posneg b/tests/20optimizer_optimizations/cmple_pow_imm_posneg new file mode 100644 index 0000000..941e86f --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_pow_imm_posneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,3) <= -125) +C=fp_lessOrEq(x*x*x, -125) diff --git a/tests/20optimizer_optimizations/cmple_pow_imm_pospos b/tests/20optimizer_optimizations/cmple_pow_imm_pospos new file mode 100644 index 0000000..6d87b0f --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_pow_imm_pospos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,2) <= 25) +C=fp_lessOrEq(x*x, 25) diff --git a/tests/20optimizer_optimizations/cmple_pow_imm_pospos_base b/tests/20optimizer_optimizations/cmple_pow_imm_pospos_base new file mode 100644 index 0000000..410c308 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_pow_imm_pospos_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(5.0625 <= pow(1.5,x)) +C=fp_lessOrEq(5.0625, fp_pow(1.5,x)) diff --git a/tests/20optimizer_optimizations/cmple_powpow_imm_base b/tests/20optimizer_optimizations/cmple_powpow_imm_base new file mode 100644 index 0000000..0a3f620 --- /dev/null +++ b/tests/20optimizer_optimizations/cmple_powpow_imm_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-6,6,1 +F=(pow(2,x) <= pow(-4,y)) +C=fp_lessOrEq(fp_pow(2,x), fp_pow(-4,y)) diff --git a/tests/20optimizer_optimizations/cmplt_add_imm b/tests/20optimizer_optimizations/cmplt_add_imm new file mode 100644 index 0000000..cebf959 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_add_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4+y) < 6) +C=fp_less(x+4+y, 6) diff --git a/tests/20optimizer_optimizations/cmplt_add_reduce b/tests/20optimizer_optimizations/cmplt_add_reduce new file mode 100644 index 0000000..ad4096f --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_add_reduce @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-6,6,1 +F=((((x*5/2)+x*x-2)) < ((x*5/2)+abs(x))) +C=fp_less(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) diff --git a/tests/20optimizer_optimizations/cmplt_addadd_imm b/tests/20optimizer_optimizations/cmplt_addadd_imm new file mode 100644 index 0000000..979a3ba --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_addadd_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4) < (y+6)) +C=fp_less(x+4, y+6) diff --git a/tests/20optimizer_optimizations/cmplt_minmax b/tests/20optimizer_optimizations/cmplt_minmax new file mode 100644 index 0000000..7128ed6 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_minmax @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x < y,x,y) +C=((fp_less(x,y)!=0)?x:y) diff --git a/tests/20optimizer_optimizations/cmplt_minmax_rev b/tests/20optimizer_optimizations/cmplt_minmax_rev new file mode 100644 index 0000000..3f12856 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_minmax_rev @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x < y,y,x) +C=((fp_less(x,y)!=0)?y:x) diff --git a/tests/20optimizer_optimizations/cmplt_mul_imm_neg b/tests/20optimizer_optimizations/cmplt_mul_imm_neg new file mode 100644 index 0000000..f2d6494 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_mul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4*y) < 6) +C=fp_less(x*-4*y, 6) diff --git a/tests/20optimizer_optimizations/cmplt_mul_imm_pos b/tests/20optimizer_optimizations/cmplt_mul_imm_pos new file mode 100644 index 0000000..429ab08 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_mul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4*y) < 6) +C=fp_less(x*4*y, 6) diff --git a/tests/20optimizer_optimizations/cmplt_mulmul_imm_neg b/tests/20optimizer_optimizations/cmplt_mulmul_imm_neg new file mode 100644 index 0000000..6b05e06 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_mulmul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4) < (y+6)) +C=fp_less(x*-4, y+6) diff --git a/tests/20optimizer_optimizations/cmplt_mulmul_imm_pos b/tests/20optimizer_optimizations/cmplt_mulmul_imm_pos new file mode 100644 index 0000000..e3d10dd --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_mulmul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4) < (y+6)) +C=fp_less(x*4, y+6) diff --git a/tests/20optimizer_optimizations/cmplt_pow_imm_negneg b/tests/20optimizer_optimizations/cmplt_pow_imm_negneg new file mode 100644 index 0000000..ab817fb --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_pow_imm_negneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-3) < -0.015625) +C=fp_less(fp_pow(x,-3), -0.015625) diff --git a/tests/20optimizer_optimizations/cmplt_pow_imm_negpos b/tests/20optimizer_optimizations/cmplt_pow_imm_negpos new file mode 100644 index 0000000..d211b51 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_pow_imm_negpos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-2) < 0.0625) +C=fp_less(fp_pow(x,-2), 0.0625) diff --git a/tests/20optimizer_optimizations/cmplt_pow_imm_posneg b/tests/20optimizer_optimizations/cmplt_pow_imm_posneg new file mode 100644 index 0000000..dc8394f --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_pow_imm_posneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,3) < -125) +C=fp_less(x*x*x, -125) diff --git a/tests/20optimizer_optimizations/cmplt_pow_imm_pospos b/tests/20optimizer_optimizations/cmplt_pow_imm_pospos new file mode 100644 index 0000000..405b191 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_pow_imm_pospos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,2) < 25) +C=fp_less(x*x, 25) diff --git a/tests/20optimizer_optimizations/cmplt_pow_imm_pospos_base b/tests/20optimizer_optimizations/cmplt_pow_imm_pospos_base new file mode 100644 index 0000000..bf691d4 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_pow_imm_pospos_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(5.0625 < pow(1.5,x)) +C=fp_less(5.0625, fp_pow(1.5,x)) diff --git a/tests/20optimizer_optimizations/cmplt_powpow_imm_base b/tests/20optimizer_optimizations/cmplt_powpow_imm_base new file mode 100644 index 0000000..e24a292 --- /dev/null +++ b/tests/20optimizer_optimizations/cmplt_powpow_imm_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-6,6,1 +F=(pow(2,x) < pow(-4,y)) +C=fp_less(fp_pow(2,x), fp_pow(-4,y)) diff --git a/tests/20optimizer_optimizations/cmpne_add_imm b/tests/20optimizer_optimizations/cmpne_add_imm new file mode 100644 index 0000000..a0ae9bc --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_add_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4+y) != 6) +C=fp_nequal(x+4+y, 6) diff --git a/tests/20optimizer_optimizations/cmpne_add_reduce b/tests/20optimizer_optimizations/cmpne_add_reduce new file mode 100644 index 0000000..b2bf6ee --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_add_reduce @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-6,6,1 +F=((((x*5/2)+x*x-2)) != ((x*5/2)+abs(x))) +C=fp_nequal(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) diff --git a/tests/20optimizer_optimizations/cmpne_addadd_imm b/tests/20optimizer_optimizations/cmpne_addadd_imm new file mode 100644 index 0000000..8aac2ac --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_addadd_imm @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x+4) != (y+6)) +C=fp_nequal(x+4, y+6) diff --git a/tests/20optimizer_optimizations/cmpne_minmax b/tests/20optimizer_optimizations/cmpne_minmax new file mode 100644 index 0000000..46dc0a9 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_minmax @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x != y,x,y) +C=((fp_nequal(x,y)!=0)?x:y) diff --git a/tests/20optimizer_optimizations/cmpne_minmax_rev b/tests/20optimizer_optimizations/cmpne_minmax_rev new file mode 100644 index 0000000..797329d --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_minmax_rev @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F=if(x != y,y,x) +C=((fp_nequal(x,y)!=0)?y:x) diff --git a/tests/20optimizer_optimizations/cmpne_mul_imm_neg b/tests/20optimizer_optimizations/cmpne_mul_imm_neg new file mode 100644 index 0000000..5a851b6 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_mul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4*y) != 6) +C=fp_nequal(x*-4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpne_mul_imm_pos b/tests/20optimizer_optimizations/cmpne_mul_imm_pos new file mode 100644 index 0000000..e96f727 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_mul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4*y) != 6) +C=fp_nequal(x*4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpne_mulmul_imm_neg b/tests/20optimizer_optimizations/cmpne_mulmul_imm_neg new file mode 100644 index 0000000..8ed54a4 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_mulmul_imm_neg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*-4) != (y+6)) +C=fp_nequal(x*-4, y+6) diff --git a/tests/20optimizer_optimizations/cmpne_mulmul_imm_pos b/tests/20optimizer_optimizations/cmpne_mulmul_imm_pos new file mode 100644 index 0000000..4cf78e9 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_mulmul_imm_pos @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 +F=((x*4) != (y+6)) +C=fp_nequal(x*4, y+6) diff --git a/tests/20optimizer_optimizations/cmpne_pow_imm_negneg b/tests/20optimizer_optimizations/cmpne_pow_imm_negneg new file mode 100644 index 0000000..a7e48cb --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_pow_imm_negneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-3) != -0.015625) +C=fp_nequal(fp_pow(x,-3), -0.015625) diff --git a/tests/20optimizer_optimizations/cmpne_pow_imm_negpos b/tests/20optimizer_optimizations/cmpne_pow_imm_negpos new file mode 100644 index 0000000..b796076 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_pow_imm_negpos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 +F=(pow(x,-2) != 0.0625) +C=fp_nequal(fp_pow(x,-2), 0.0625) diff --git a/tests/20optimizer_optimizations/cmpne_pow_imm_posneg b/tests/20optimizer_optimizations/cmpne_pow_imm_posneg new file mode 100644 index 0000000..d6922d2 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_pow_imm_posneg @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,3) != -125) +C=fp_nequal(x*x*x, -125) diff --git a/tests/20optimizer_optimizations/cmpne_pow_imm_pospos b/tests/20optimizer_optimizations/cmpne_pow_imm_pospos new file mode 100644 index 0000000..3e72cc8 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_pow_imm_pospos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(pow(x,2) != 25) +C=fp_nequal(x*x, 25) diff --git a/tests/20optimizer_optimizations/cmpne_pow_imm_pospos_base b/tests/20optimizer_optimizations/cmpne_pow_imm_pospos_base new file mode 100644 index 0000000..a83614a --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_pow_imm_pospos_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 +F=(5.0625 != pow(1.5,x)) +C=fp_nequal(5.0625, fp_pow(1.5,x)) diff --git a/tests/20optimizer_optimizations/cmpne_powpow_imm_base b/tests/20optimizer_optimizations/cmpne_powpow_imm_base new file mode 100644 index 0000000..ce9c41d --- /dev/null +++ b/tests/20optimizer_optimizations/cmpne_powpow_imm_base @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-6,6,1 +F=(pow(2,x) != pow(-4,y)) +C=fp_nequal(fp_pow(2,x), fp_pow(-4,y)) diff --git a/tests/20optimizer_optimizations/cmpzz_add_imm b/tests/20optimizer_optimizations/cmpzz_add_imm new file mode 100644 index 0000000..e1dcb55 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_add_imm @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 + +# Combine tests: +# cmplt_add_imm +# cmple_add_imm +# cmpgt_add_imm +# cmpge_add_imm +# cmpne_add_imm +# cmpeq_add_imm + +F=0x0001 * ((x+4+y) < 6) + \ + 0x0002 * ((x+4+y) <= 6) + \ + 0x0004 * ((x+4+y) > 6) + \ + 0x0008 * ((x+4+y) >= 6) + \ + 0x0010 * ((x+4+y) != 6) + \ + 0x0020 * ((x+4+y) = 6) +C=0x0001 * fp_less(x+4+y, 6) + \ + 0x0002 * fp_lessOrEq(x+4+y, 6) + \ + 0x0004 * fp_greater(x+4+y, 6) + \ + 0x0008 * fp_greaterOrEq(x+4+y, 6) + \ + 0x0010 * fp_nequal(x+4+y, 6) + \ + 0x0020 * fp_equal(x+4+y, 6) diff --git a/tests/20optimizer_optimizations/cmpzz_add_reduce b/tests/20optimizer_optimizations/cmpzz_add_reduce new file mode 100644 index 0000000..837c52f --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_add_reduce @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-6,6,1 + +# Combine tests: +# cmplt_add_reduce +# cmple_add_reduce +# cmpgt_add_reduce +# cmpge_add_reduce +# cmpne_add_reduce +# cmpeq_add_reduce + +F=0x0001 * ((((x*5/2)+x*x-2)) < ((x*5/2)+abs(x))) + \ + 0x0002 * ((((x*5/2)+x*x-2)) <= ((x*5/2)+abs(x))) + \ + 0x0004 * ((((x*5/2)+x*x-2)) > ((x*5/2)+abs(x))) + \ + 0x0008 * ((((x*5/2)+x*x-2)) >= ((x*5/2)+abs(x))) + \ + 0x0010 * ((((x*5/2)+x*x-2)) != ((x*5/2)+abs(x))) + \ + 0x0020 * ((((x*5/2)+x*x-2)) = ((x*5/2)+abs(x))) +C=0x0001 * fp_less(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) + \ + 0x0002 * fp_lessOrEq(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) + \ + 0x0004 * fp_greater(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) + \ + 0x0008 * fp_greaterOrEq(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) + \ + 0x0010 * fp_nequal(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) + \ + 0x0020 * fp_equal(((x*5/2)+x*x-2), ((x*5/2)+fp_abs(x))) diff --git a/tests/20optimizer_optimizations/cmpzz_addadd_imm b/tests/20optimizer_optimizations/cmpzz_addadd_imm new file mode 100644 index 0000000..000f93d --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_addadd_imm @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 + +# Combine tests: +# cmplt_addadd_imm +# cmple_addadd_imm +# cmpgt_addadd_imm +# cmpge_addadd_imm +# cmpne_addadd_imm +# cmpeq_addadd_imm + +F=0x0001 * ((x+4) < (y+6)) + \ + 0x0002 * ((x+4) <= (y+6)) + \ + 0x0004 * ((x+4) > (y+6)) + \ + 0x0008 * ((x+4) >= (y+6)) + \ + 0x0010 * ((x+4) != (y+6)) + \ + 0x0020 * ((x+4) = (y+6)) +C=0x0001 * fp_less(x+4, y+6) + \ + 0x0002 * fp_lessOrEq(x+4, y+6) + \ + 0x0004 * fp_greater(x+4, y+6) + \ + 0x0008 * fp_greaterOrEq(x+4, y+6) + \ + 0x0010 * fp_nequal(x+4, y+6) + \ + 0x0020 * fp_equal(x+4, y+6) diff --git a/tests/20optimizer_optimizations/cmpzz_minmax b/tests/20optimizer_optimizations/cmpzz_minmax new file mode 100644 index 0000000..0e24260 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_minmax @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 + +# Combine tests: +# cmplt_minmax +# cmple_minmax +# cmpgt_minmax +# cmpge_minmax +# cmpne_minmax +# cmpeq_minmax + +F=0x0001 * if(x < y,x,y) + \ + 0x0002 * if(x <= y,x,y) + \ + 0x0004 * if(x > y,x,y) + \ + 0x0008 * if(x >= y,x,y) + \ + 0x0010 * if(x != y,x,y) + \ + 0x0020 * if(x = y,x,y) +C=0x0001 * ((fp_less(x,y)!=0)?x:y) + \ + 0x0002 * ((fp_lessOrEq(x,y)!=0)?x:y) + \ + 0x0004 * ((fp_greater(x,y)!=0)?x:y) + \ + 0x0008 * ((fp_greaterOrEq(x,y)!=0)?x:y) + \ + 0x0010 * ((fp_nequal(x,y)!=0)?x:y) + \ + 0x0020 * ((fp_equal(x,y)!=0)?x:y) diff --git a/tests/20optimizer_optimizations/cmpzz_minmax_rev b/tests/20optimizer_optimizations/cmpzz_minmax_rev new file mode 100644 index 0000000..5795b8c --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_minmax_rev @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 + +# Combine tests: +# cmplt_minmax_rev +# cmple_minmax_rev +# cmpgt_minmax_rev +# cmpge_minmax_rev +# cmpne_minmax_rev +# cmpeq_minmax_rev + +F=0x0001 * if(x < y,y,x) + \ + 0x0002 * if(x <= y,y,x) + \ + 0x0004 * if(x > y,y,x) + \ + 0x0008 * if(x >= y,y,x) + \ + 0x0010 * if(x != y,y,x) + \ + 0x0020 * if(x = y,y,x) +C=0x0001 * ((fp_less(x,y)!=0)?y:x) + \ + 0x0002 * ((fp_lessOrEq(x,y)!=0)?y:x) + \ + 0x0004 * ((fp_greater(x,y)!=0)?y:x) + \ + 0x0008 * ((fp_greaterOrEq(x,y)!=0)?y:x) + \ + 0x0010 * ((fp_nequal(x,y)!=0)?y:x) + \ + 0x0020 * ((fp_equal(x,y)!=0)?y:x) diff --git a/tests/20optimizer_optimizations/cmpzz_mul_imm_neg b/tests/20optimizer_optimizations/cmpzz_mul_imm_neg new file mode 100644 index 0000000..5e09b2f --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_mul_imm_neg @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 + +# Combine tests: +# cmplt_mul_imm_neg +# cmple_mul_imm_neg +# cmpgt_mul_imm_neg +# cmpge_mul_imm_neg +# cmpne_mul_imm_neg +# cmpeq_mul_imm_neg + +F=0x0001 * ((x*-4*y) < 6) + \ + 0x0002 * ((x*-4*y) <= 6) + \ + 0x0004 * ((x*-4*y) > 6) + \ + 0x0008 * ((x*-4*y) >= 6) + \ + 0x0010 * ((x*-4*y) != 6) + \ + 0x0020 * ((x*-4*y) = 6) +C=0x0001 * fp_less(x*-4*y, 6) + \ + 0x0002 * fp_lessOrEq(x*-4*y, 6) + \ + 0x0004 * fp_greater(x*-4*y, 6) + \ + 0x0008 * fp_greaterOrEq(x*-4*y, 6) + \ + 0x0010 * fp_nequal(x*-4*y, 6) + \ + 0x0020 * fp_equal(x*-4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpzz_mul_imm_pos b/tests/20optimizer_optimizations/cmpzz_mul_imm_pos new file mode 100644 index 0000000..d15af75 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_mul_imm_pos @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 + +# Combine tests: +# cmplt_mul_imm_pos +# cmple_mul_imm_pos +# cmpgt_mul_imm_pos +# cmpge_mul_imm_pos +# cmpne_mul_imm_pos +# cmpeq_mul_imm_pos + +F=0x0001 * ((x*4*y) < 6) + \ + 0x0002 * ((x*4*y) <= 6) + \ + 0x0004 * ((x*4*y) > 6) + \ + 0x0008 * ((x*4*y) >= 6) + \ + 0x0010 * ((x*4*y) != 6) + \ + 0x0020 * ((x*4*y) = 6) +C=0x0001 * fp_less(x*4*y, 6) + \ + 0x0002 * fp_lessOrEq(x*4*y, 6) + \ + 0x0004 * fp_greater(x*4*y, 6) + \ + 0x0008 * fp_greaterOrEq(x*4*y, 6) + \ + 0x0010 * fp_nequal(x*4*y, 6) + \ + 0x0020 * fp_equal(x*4*y, 6) diff --git a/tests/20optimizer_optimizations/cmpzz_mulmul_imm_neg b/tests/20optimizer_optimizations/cmpzz_mulmul_imm_neg new file mode 100644 index 0000000..14dab04 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_mulmul_imm_neg @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 + +# Combine tests: +# cmplt_mulmul_imm_neg +# cmple_mulmul_imm_neg +# cmpgt_mulmul_imm_neg +# cmpge_mulmul_imm_neg +# cmpne_mulmul_imm_neg +# cmpeq_mulmul_imm_neg + +F=0x0001 * ((x*-4) < (y+6)) + \ + 0x0002 * ((x*-4) <= (y+6)) + \ + 0x0004 * ((x*-4) > (y+6)) + \ + 0x0008 * ((x*-4) >= (y+6)) + \ + 0x0010 * ((x*-4) != (y+6)) + \ + 0x0020 * ((x*-4) = (y+6)) +C=0x0001 * fp_less(x*-4, y+6) + \ + 0x0002 * fp_lessOrEq(x*-4, y+6) + \ + 0x0004 * fp_greater(x*-4, y+6) + \ + 0x0008 * fp_greaterOrEq(x*-4, y+6) + \ + 0x0010 * fp_nequal(x*-4, y+6) + \ + 0x0020 * fp_equal(x*-4, y+6) diff --git a/tests/20optimizer_optimizations/cmpzz_mulmul_imm_pos b/tests/20optimizer_optimizations/cmpzz_mulmul_imm_pos new file mode 100644 index 0000000..ba0df17 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_mulmul_imm_pos @@ -0,0 +1,24 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-6,6,1 + +# Combine tests: +# cmplt_mulmul_imm_pos +# cmple_mulmul_imm_pos +# cmpgt_mulmul_imm_pos +# cmpge_mulmul_imm_pos +# cmpne_mulmul_imm_pos +# cmpeq_mulmul_imm_pos + +F=0x0001 * ((x*4) < (y+6)) + \ + 0x0002 * ((x*4) <= (y+6)) + \ + 0x0004 * ((x*4) > (y+6)) + \ + 0x0008 * ((x*4) >= (y+6)) + \ + 0x0010 * ((x*4) != (y+6)) + \ + 0x0020 * ((x*4) = (y+6)) +C=0x0001 * fp_less(x*4, y+6) + \ + 0x0002 * fp_lessOrEq(x*4, y+6) + \ + 0x0004 * fp_greater(x*4, y+6) + \ + 0x0008 * fp_greaterOrEq(x*4, y+6) + \ + 0x0010 * fp_nequal(x*4, y+6) + \ + 0x0020 * fp_equal(x*4, y+6) diff --git a/tests/20optimizer_optimizations/cmpzz_pow_imm_negneg b/tests/20optimizer_optimizations/cmpzz_pow_imm_negneg new file mode 100644 index 0000000..07de6da --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_pow_imm_negneg @@ -0,0 +1,24 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 + +# Combine tests: +# cmplt_pow_imm_negneg +# cmple_pow_imm_negneg +# cmpgt_pow_imm_negneg +# cmpge_pow_imm_negneg +# cmpne_pow_imm_negneg +# cmpeq_pow_imm_negneg + +F=0x0001 * (pow(x,-3) < -0.015625) + \ + 0x0002 * (pow(x,-3) <= -0.015625) + \ + 0x0004 * (pow(x,-3) > -0.015625) + \ + 0x0008 * (pow(x,-3) >= -0.015625) + \ + 0x0010 * (pow(x,-3) != -0.015625) + \ + 0x0020 * (pow(x,-3) = -0.015625) +C=0x0001 * fp_less(fp_pow(x,-3), -0.015625) + \ + 0x0002 * fp_lessOrEq(fp_pow(x,-3), -0.015625) + \ + 0x0004 * fp_greater(fp_pow(x,-3), -0.015625) + \ + 0x0008 * fp_greaterOrEq(fp_pow(x,-3), -0.015625) + \ + 0x0010 * fp_nequal(fp_pow(x,-3), -0.015625) + \ + 0x0020 * fp_equal(fp_pow(x,-3), -0.015625) diff --git a/tests/20optimizer_optimizations/cmpzz_pow_imm_negpos b/tests/20optimizer_optimizations/cmpzz_pow_imm_negpos new file mode 100644 index 0000000..e2a9c29 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_pow_imm_negpos @@ -0,0 +1,24 @@ +T=d ld f mf cd cf cld +V=x +R=-5,5,2 + +# Combine tests: +# cmplt_pow_imm_negpos +# cmple_pow_imm_negpos +# cmpgt_pow_imm_negpos +# cmpge_pow_imm_negpos +# cmpne_pow_imm_negpos +# cmpeq_pow_imm_negpos + +F=0x0001 * (pow(x,-2) < 0.0625) + \ + 0x0002 * (pow(x,-2) <= 0.0625) + \ + 0x0004 * (pow(x,-2) > 0.0625) + \ + 0x0008 * (pow(x,-2) >= 0.0625) + \ + 0x0010 * (pow(x,-2) != 0.0625) + \ + 0x0020 * (pow(x,-2) = 0.0625) +C=0x0001 * fp_less(fp_pow(x,-2), 0.0625) + \ + 0x0002 * fp_lessOrEq(fp_pow(x,-2), 0.0625) + \ + 0x0004 * fp_greater(fp_pow(x,-2), 0.0625) + \ + 0x0008 * fp_greaterOrEq(fp_pow(x,-2), 0.0625) + \ + 0x0010 * fp_nequal(fp_pow(x,-2), 0.0625) + \ + 0x0020 * fp_equal(fp_pow(x,-2), 0.0625) diff --git a/tests/20optimizer_optimizations/cmpzz_pow_imm_posneg b/tests/20optimizer_optimizations/cmpzz_pow_imm_posneg new file mode 100644 index 0000000..de4afe3 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_pow_imm_posneg @@ -0,0 +1,24 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 + +# Combine tests: +# cmplt_pow_imm_posneg +# cmple_pow_imm_posneg +# cmpgt_pow_imm_posneg +# cmpge_pow_imm_posneg +# cmpne_pow_imm_posneg +# cmpeq_pow_imm_posneg + +F=0x0001 * (pow(x,3) < -125) + \ + 0x0002 * (pow(x,3) <= -125) + \ + 0x0004 * (pow(x,3) > -125) + \ + 0x0008 * (pow(x,3) >= -125) + \ + 0x0010 * (pow(x,3) != -125) + \ + 0x0020 * (pow(x,3) = -125) +C=0x0001 * fp_less(x*x*x, -125) + \ + 0x0002 * fp_lessOrEq(x*x*x, -125) + \ + 0x0004 * fp_greater(x*x*x, -125) + \ + 0x0008 * fp_greaterOrEq(x*x*x, -125) + \ + 0x0010 * fp_nequal(x*x*x, -125) + \ + 0x0020 * fp_equal(x*x*x, -125) diff --git a/tests/20optimizer_optimizations/cmpzz_pow_imm_pospos b/tests/20optimizer_optimizations/cmpzz_pow_imm_pospos new file mode 100644 index 0000000..56ce5cc --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_pow_imm_pospos @@ -0,0 +1,24 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 + +# Combine tests: +# cmplt_pow_imm_pospos +# cmple_pow_imm_pospos +# cmpgt_pow_imm_pospos +# cmpge_pow_imm_pospos +# cmpne_pow_imm_pospos +# cmpeq_pow_imm_pospos + +F=0x0001 * (pow(x,2) < 25) + \ + 0x0002 * (pow(x,2) <= 25) + \ + 0x0004 * (pow(x,2) > 25) + \ + 0x0008 * (pow(x,2) >= 25) + \ + 0x0010 * (pow(x,2) != 25) + \ + 0x0020 * (pow(x,2) = 25) +C=0x0001 * fp_less(x*x, 25) + \ + 0x0002 * fp_lessOrEq(x*x, 25) + \ + 0x0004 * fp_greater(x*x, 25) + \ + 0x0008 * fp_greaterOrEq(x*x, 25) + \ + 0x0010 * fp_nequal(x*x, 25) + \ + 0x0020 * fp_equal(x*x, 25) diff --git a/tests/20optimizer_optimizations/cmpzz_pow_imm_pospos_base b/tests/20optimizer_optimizations/cmpzz_pow_imm_pospos_base new file mode 100644 index 0000000..34f5918 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_pow_imm_pospos_base @@ -0,0 +1,24 @@ +T=d ld f mf cd cf cld +V=x +R=-6,6,1 + +# Combine tests: +# cmplt_pow_imm_pospos_base +# cmple_pow_imm_pospos_base +# cmpgt_pow_imm_pospos_base +# cmpge_pow_imm_pospos_base +# cmpne_pow_imm_pospos_base +# cmpeq_pow_imm_pospos_base + +F=0x0001 * (5.0625 < pow(1.5,x)) + \ + 0x0002 * (5.0625 <= pow(1.5,x)) + \ + 0x0004 * (5.0625 > pow(1.5,x)) + \ + 0x0008 * (5.0625 >= pow(1.5,x)) + \ + 0x0010 * (5.0625 != pow(1.5,x)) + \ + 0x0020 * (5.0625 = pow(1.5,x)) +C=0x0001 * fp_less(5.0625, fp_pow(1.5,x)) + \ + 0x0002 * fp_lessOrEq(5.0625, fp_pow(1.5,x)) + \ + 0x0004 * fp_greater(5.0625, fp_pow(1.5,x)) + \ + 0x0008 * fp_greaterOrEq(5.0625, fp_pow(1.5,x)) + \ + 0x0010 * fp_nequal(5.0625, fp_pow(1.5,x)) + \ + 0x0020 * fp_equal(5.0625, fp_pow(1.5,x)) diff --git a/tests/20optimizer_optimizations/cmpzz_powpow_imm_base b/tests/20optimizer_optimizations/cmpzz_powpow_imm_base new file mode 100644 index 0000000..f5d59c8 --- /dev/null +++ b/tests/20optimizer_optimizations/cmpzz_powpow_imm_base @@ -0,0 +1,24 @@ +T=d ld f mf cd cf cld +V=x,y +R=-6,6,1 + +# Combine tests: +# cmplt_powpow_imm_base +# cmple_powpow_imm_base +# cmpgt_powpow_imm_base +# cmpge_powpow_imm_base +# cmpne_powpow_imm_base +# cmpeq_powpow_imm_base + +F=0x0001 * (pow(2,x) < pow(-4,y)) + \ + 0x0002 * (pow(2,x) <= pow(-4,y)) + \ + 0x0004 * (pow(2,x) > pow(-4,y)) + \ + 0x0008 * (pow(2,x) >= pow(-4,y)) + \ + 0x0010 * (pow(2,x) != pow(-4,y)) + \ + 0x0020 * (pow(2,x) = pow(-4,y)) +C=0x0001 * fp_less(fp_pow(2,x), fp_pow(-4,y)) + \ + 0x0002 * fp_lessOrEq(fp_pow(2,x), fp_pow(-4,y)) + \ + 0x0004 * fp_greater(fp_pow(2,x), fp_pow(-4,y)) + \ + 0x0008 * fp_greaterOrEq(fp_pow(2,x), fp_pow(-4,y)) + \ + 0x0010 * fp_nequal(fp_pow(2,x), fp_pow(-4,y)) + \ + 0x0020 * fp_equal(fp_pow(2,x), fp_pow(-4,y)) diff --git a/tests/20optimizer_optimizations/eq0 b/tests/20optimizer_optimizations/eq0 new file mode 100644 index 0000000..387a914 --- /dev/null +++ b/tests/20optimizer_optimizations/eq0 @@ -0,0 +1,6 @@ +T=d f ld li cd cf cld +V=x +R=0,1,1 +F=(x=if(1,0,0)) + (if(1,0,0)=x) +C=fp_equal(x,0) + fp_equal(0,x) + diff --git a/tests/20optimizer_optimizations/eq1 b/tests/20optimizer_optimizations/eq1 new file mode 100644 index 0000000..cd2e6a9 --- /dev/null +++ b/tests/20optimizer_optimizations/eq1 @@ -0,0 +1,6 @@ +T=d f ld li cd cf cld +V=x +R=0,1,1 +F=(!x=if(1,1,1)) +C=fp_equal(fp_not(x),1) + diff --git a/tests/20optimizer_optimizations/expexp_a b/tests/20optimizer_optimizations/expexp_a new file mode 100644 index 0000000..85deaad --- /dev/null +++ b/tests/20optimizer_optimizations/expexp_a @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y +R=-2,2,0.5 +F=exp(x*2 + y*3) +C=fp_exp(x*2 + y*3) diff --git a/tests/20optimizer_optimizations/expexp_b b/tests/20optimizer_optimizations/expexp_b new file mode 100644 index 0000000..8b2b589 --- /dev/null +++ b/tests/20optimizer_optimizations/expexp_b @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y,z +R=-2,2,0.5 +F=exp(x) * exp(y+z) +C=fp_exp(x) * fp_exp(y+z) diff --git a/tests/20optimizer_optimizations/expexp_c b/tests/20optimizer_optimizations/expexp_c new file mode 100644 index 0000000..c0c2ed3 --- /dev/null +++ b/tests/20optimizer_optimizations/expexp_c @@ -0,0 +1,5 @@ +T=d f ld mf cd cf cld +V=x,y,z +R=-2,2,0.5 +F=exp(x + y*z) +C=fp_exp(x + y*z) diff --git a/tests/20optimizer_optimizations/ge0_abs b/tests/20optimizer_optimizations/ge0_abs new file mode 100644 index 0000000..fb944cb --- /dev/null +++ b/tests/20optimizer_optimizations/ge0_abs @@ -0,0 +1,11 @@ +T=d f ld li cd cf cld +V=x +R=-1,1,1 +F=(abs(x) >= if(1,0,0)) + \ + 2*(if(1,0,0) <= abs(x)) + \ + 4*(abs(x) <= if(1,0,0)) + \ + 8*(if(1,0,0) >= abs(x)) +C=fp_greaterOrEq(fp_abs(x), 0) + \ + 2*fp_lessOrEq(0, fp_abs(x)) + \ + 4*fp_lessOrEq(fp_abs(x), 0) + \ + 8*fp_greaterOrEq(0, fp_abs(x)) diff --git a/tests/20optimizer_optimizations/ge1_abs b/tests/20optimizer_optimizations/ge1_abs new file mode 100644 index 0000000..829851c --- /dev/null +++ b/tests/20optimizer_optimizations/ge1_abs @@ -0,0 +1,11 @@ +T=d f ld li cd cf cld +V=x +R=-1,1,1 +F=(abs(x) >= if(1,1,1)) + \ + 2*(if(1,1,1) <= abs(x)) + \ + 4*(abs(x) <= if(1,1,1)) + \ + 8*(if(1,1,1) >= abs(x)) +C=fp_greaterOrEq(fp_abs(x), 1) + \ + 2*fp_lessOrEq(1, fp_abs(x)) + \ + 4*fp_lessOrEq(fp_abs(x), 1) + \ + 8*fp_greaterOrEq(1, fp_abs(x)) diff --git a/tests/20optimizer_optimizations/ge_and_eq b/tests/20optimizer_optimizations/ge_and_eq new file mode 100644 index 0000000..bd7dde6 --- /dev/null +++ b/tests/20optimizer_optimizations/ge_and_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x >= y) & (x = y) +C= x == y diff --git a/tests/20optimizer_optimizations/ge_and_le b/tests/20optimizer_optimizations/ge_and_le new file mode 100644 index 0000000..5987471 --- /dev/null +++ b/tests/20optimizer_optimizations/ge_and_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x >= y) & (x <= y) +C= x == y diff --git a/tests/20optimizer_optimizations/ge_and_ne b/tests/20optimizer_optimizations/ge_and_ne new file mode 100644 index 0000000..60c3649 --- /dev/null +++ b/tests/20optimizer_optimizations/ge_and_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x >= y) & (x != y) +C= x > y diff --git a/tests/20optimizer_optimizations/ge_or_eq b/tests/20optimizer_optimizations/ge_or_eq new file mode 100644 index 0000000..b47128a --- /dev/null +++ b/tests/20optimizer_optimizations/ge_or_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x >= y) | (x = y) +C= x >= y diff --git a/tests/20optimizer_optimizations/ge_or_le b/tests/20optimizer_optimizations/ge_or_le new file mode 100644 index 0000000..8dbe3cb --- /dev/null +++ b/tests/20optimizer_optimizations/ge_or_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x >= y) | (x <= y) +C= x*0+y*0+ 1 diff --git a/tests/20optimizer_optimizations/ge_or_ne b/tests/20optimizer_optimizations/ge_or_ne new file mode 100644 index 0000000..e1fe3d0 --- /dev/null +++ b/tests/20optimizer_optimizations/ge_or_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x >= y) | (x != y) +C= x*0+y*0+ 1 diff --git a/tests/20optimizer_optimizations/gehalf b/tests/20optimizer_optimizations/gehalf new file mode 100644 index 0000000..43c533b --- /dev/null +++ b/tests/20optimizer_optimizations/gehalf @@ -0,0 +1,5 @@ +T=d f cd cf +V=x +R=-1,1,0.25 +F=x>=if(1,0.5,0) +C=fp_greaterOrEq(x, 0.5) diff --git a/tests/20optimizer_optimizations/gt0_abs b/tests/20optimizer_optimizations/gt0_abs new file mode 100644 index 0000000..8e4d4dc --- /dev/null +++ b/tests/20optimizer_optimizations/gt0_abs @@ -0,0 +1,11 @@ +T=d f ld li cd cf cld +V=x +R=-1,1,1 +F=(abs(x) > if(1,0,0)) + \ + 2*(if(1,0,0) < abs(x)) + \ + 4*(abs(x) < if(1,0,0)) + \ + 8*(if(1,0,0) > abs(x)) +C=fp_greater(fp_abs(x), 0) + \ + 2*fp_less(0, fp_abs(x)) + \ + 4*fp_less(fp_abs(x), 0) + \ + 8*fp_greater(0, fp_abs(x)) diff --git a/tests/20optimizer_optimizations/gt1_abs b/tests/20optimizer_optimizations/gt1_abs new file mode 100644 index 0000000..63bc1e3 --- /dev/null +++ b/tests/20optimizer_optimizations/gt1_abs @@ -0,0 +1,11 @@ +T=d f ld li cd cf cld +V=x +R=-1,1,1 +F=(abs(x) > if(1,1,1)) + \ + 2*(if(1,1,1) < abs(x)) + \ + 4*(abs(x) < if(1,1,1)) + \ + 8*(if(1,1,1) > abs(x)) +C=fp_greater(fp_abs(x), 1) + \ + 2*fp_less(1, fp_abs(x)) + \ + 4*fp_less(fp_abs(x), 1) + \ + 8*fp_greater(1, fp_abs(x)) diff --git a/tests/20optimizer_optimizations/gt_and_eq b/tests/20optimizer_optimizations/gt_and_eq new file mode 100644 index 0000000..d6681dc --- /dev/null +++ b/tests/20optimizer_optimizations/gt_and_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) & (x = y) +C= x*0+y*0+ 0 diff --git a/tests/20optimizer_optimizations/gt_and_ge b/tests/20optimizer_optimizations/gt_and_ge new file mode 100644 index 0000000..f93a6ea --- /dev/null +++ b/tests/20optimizer_optimizations/gt_and_ge @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) & (x >= y) +C= x > y diff --git a/tests/20optimizer_optimizations/gt_and_le b/tests/20optimizer_optimizations/gt_and_le new file mode 100644 index 0000000..d47b61e --- /dev/null +++ b/tests/20optimizer_optimizations/gt_and_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) & (x <= y) +C= x*0+y*0+ 0 diff --git a/tests/20optimizer_optimizations/gt_and_ne b/tests/20optimizer_optimizations/gt_and_ne new file mode 100644 index 0000000..3dcbe48 --- /dev/null +++ b/tests/20optimizer_optimizations/gt_and_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) & (x != y) +C= x > y diff --git a/tests/20optimizer_optimizations/gt_or_eq b/tests/20optimizer_optimizations/gt_or_eq new file mode 100644 index 0000000..92ae8c3 --- /dev/null +++ b/tests/20optimizer_optimizations/gt_or_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) | (x = y) +C= x >= y diff --git a/tests/20optimizer_optimizations/gt_or_ge b/tests/20optimizer_optimizations/gt_or_ge new file mode 100644 index 0000000..2b0f179 --- /dev/null +++ b/tests/20optimizer_optimizations/gt_or_ge @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) | (x >= y) +C= x >= y diff --git a/tests/20optimizer_optimizations/gt_or_le b/tests/20optimizer_optimizations/gt_or_le new file mode 100644 index 0000000..a7fb818 --- /dev/null +++ b/tests/20optimizer_optimizations/gt_or_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) | (x <= y) +C= x*0+y*0+ 1 diff --git a/tests/20optimizer_optimizations/gt_or_ne b/tests/20optimizer_optimizations/gt_or_ne new file mode 100644 index 0000000..8c146f4 --- /dev/null +++ b/tests/20optimizer_optimizations/gt_or_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x > y) | (x != y) +C= x != y diff --git a/tests/20optimizer_optimizations/if10 b/tests/20optimizer_optimizations/if10 new file mode 100644 index 0000000..7e997fa --- /dev/null +++ b/tests/20optimizer_optimizations/if10 @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x +R=0,1,1 +F=if(x,1,0) + 10*if(x,0,1) + 100*if(x>0,1,0) + 1000*if(x>0,0,1) +C=fp_notNot(x) + 10*fp_not(x) + 100*fp_greater(x,0) + 1000*fp_lessOrEq(x,0) diff --git a/tests/20optimizer_optimizations/if_extract_abs b/tests/20optimizer_optimizations/if_extract_abs new file mode 100644 index 0000000..bd8fffc --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_abs @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, abs(x+2), abs(y+5)) +C=fp_abs(fp_truth(x)!=0 ? (x+2) : (y+5)) diff --git a/tests/20optimizer_optimizations/if_extract_add b/tests/20optimizer_optimizations/if_extract_add new file mode 100644 index 0000000..8a6a356 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_add @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, y+2, y+5) +C=y + (fp_truth(x)!=0 ? 2 : 5) diff --git a/tests/20optimizer_optimizations/if_extract_add1 b/tests/20optimizer_optimizations/if_extract_add1 new file mode 100644 index 0000000..f9e5f64 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_add1 @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, y+2, y) +C=fp_truth(x)!=0 ? (y+2) : y diff --git a/tests/20optimizer_optimizations/if_extract_add2 b/tests/20optimizer_optimizations/if_extract_add2 new file mode 100644 index 0000000..117d839 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_add2 @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, y, y+2) +C=fp_truth(x)!=0 ? y : (y+2) diff --git a/tests/20optimizer_optimizations/if_extract_and1_l b/tests/20optimizer_optimizations/if_extract_and1_l new file mode 100644 index 0000000..c4fe4ee --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_and1_l @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, y&z, y<1) +C=fp_truth(x)!=0 ? fp_and(y,z) : fp_less(y,1) diff --git a/tests/20optimizer_optimizations/if_extract_and1_nl b/tests/20optimizer_optimizations/if_extract_and1_nl new file mode 100644 index 0000000..6b6429c --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_and1_nl @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, y&z, z) +C=fp_truth(x)!=0 ? fp_and(y,z) : z diff --git a/tests/20optimizer_optimizations/if_extract_and2_l b/tests/20optimizer_optimizations/if_extract_and2_l new file mode 100644 index 0000000..19944c1 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_and2_l @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, y<1, y&z) +C=fp_truth(x)!=0 ? fp_less(y,1) : fp_and(y,z) diff --git a/tests/20optimizer_optimizations/if_extract_and2_nl b/tests/20optimizer_optimizations/if_extract_and2_nl new file mode 100644 index 0000000..b4540d6 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_and2_nl @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, z, y&z) +C=fp_truth(x)!=0 ? z : fp_and(y,z) diff --git a/tests/20optimizer_optimizations/if_extract_div b/tests/20optimizer_optimizations/if_extract_div new file mode 100644 index 0000000..08b42ac --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_div @@ -0,0 +1,5 @@ +T=li gi +V=x,y +R=-2,2,1 +F=if(x, y/x, y/2) +C=y / (fp_truth(x)!=0 ? x : 2) diff --git a/tests/20optimizer_optimizations/if_extract_min b/tests/20optimizer_optimizations/if_extract_min new file mode 100644 index 0000000..5a7e9fa --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_min @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, min(y,2), min(y,5)) +C=fp_min(y, (fp_truth(x)!=0 ? 2 : 5)) diff --git a/tests/20optimizer_optimizations/if_extract_mul b/tests/20optimizer_optimizations/if_extract_mul new file mode 100644 index 0000000..5b46336 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_mul @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, y*2, y*5) +C=y * (fp_truth(x)!=0 ? 2 : 5) diff --git a/tests/20optimizer_optimizations/if_extract_mul1 b/tests/20optimizer_optimizations/if_extract_mul1 new file mode 100644 index 0000000..34b2f22 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_mul1 @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, y*2, y) +C=fp_truth(x)!=0 ? (y*2) : y diff --git a/tests/20optimizer_optimizations/if_extract_mul2 b/tests/20optimizer_optimizations/if_extract_mul2 new file mode 100644 index 0000000..b943e7b --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_mul2 @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=if(x, y, y*2) +C=fp_truth(x)!=0 ? y : (y*2) diff --git a/tests/20optimizer_optimizations/if_extract_or1_l b/tests/20optimizer_optimizations/if_extract_or1_l new file mode 100644 index 0000000..f26e021 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_or1_l @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, y|z, y<1) +C=fp_truth(x)!=0 ? fp_or(y,z) : fp_less(y,1) diff --git a/tests/20optimizer_optimizations/if_extract_or1_nl b/tests/20optimizer_optimizations/if_extract_or1_nl new file mode 100644 index 0000000..98f73a9 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_or1_nl @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, y|z, z) +C=fp_truth(x)!=0 ? fp_or(y,z) : z diff --git a/tests/20optimizer_optimizations/if_extract_or2_l b/tests/20optimizer_optimizations/if_extract_or2_l new file mode 100644 index 0000000..bbfbf47 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_or2_l @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, y<1, y|z) +C=fp_truth(x)!=0 ? fp_less(y,1) : fp_or(y,z) diff --git a/tests/20optimizer_optimizations/if_extract_or2_nl b/tests/20optimizer_optimizations/if_extract_or2_nl new file mode 100644 index 0000000..28fe68a --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_or2_nl @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=-1,1,1 +F=if(x, z, y|z) +C=fp_truth(x)!=0 ? z : fp_or(y,z) diff --git a/tests/20optimizer_optimizations/if_extract_sin b/tests/20optimizer_optimizations/if_extract_sin new file mode 100644 index 0000000..2b4f511 --- /dev/null +++ b/tests/20optimizer_optimizations/if_extract_sin @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-4,4,0.5 +F=if(x, sin(y), sin(x)) +C=fp_sin(fp_truth(x)!=0 ? y : x) diff --git a/tests/20optimizer_optimizations/if_join_add b/tests/20optimizer_optimizations/if_join_add new file mode 100644 index 0000000..94e213d --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_add @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=3,5,0.5 +F=if(x<4, sin(y),cos(y+1)) + if(x<4, cos(y),sin(y+1)) +C=fp_less(x,4)!=0 ? (fp_sin(y)+fp_cos(y)) : (fp_cos(y+1)+fp_sin(y+1)) diff --git a/tests/20optimizer_optimizations/if_join_add2 b/tests/20optimizer_optimizations/if_join_add2 new file mode 100644 index 0000000..fc02b59 --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_add2 @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=x +R=3,5,1 +F=x + 10 + if(x<4, 3,4) +C=x + (fp_less(x,4)!=0 ? 13 : 14) diff --git a/tests/20optimizer_optimizations/if_join_and b/tests/20optimizer_optimizations/if_join_and new file mode 100644 index 0000000..494d961 --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_and @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=3,5,0.5 +F=if(x<4, sin(y),cos(y+1)) & if(x<4, cos(y),sin(y+1)) +C=fp_less(x,4)!=0 ? fp_and(fp_sin(y),fp_cos(y)) : fp_and(fp_cos(y+1),fp_sin(y+1)) diff --git a/tests/20optimizer_optimizations/if_join_max b/tests/20optimizer_optimizations/if_join_max new file mode 100644 index 0000000..ce27bed --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_max @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=3,5,0.5 +F=max(if(x<4, sin(y),cos(y+1)), if(x<4, cos(y),sin(y+1))) +C=fp_less(x,4)!=0 ? fp_max(fp_sin(y),fp_cos(y)) : fp_max(fp_cos(y+1),fp_sin(y+1)) diff --git a/tests/20optimizer_optimizations/if_join_min b/tests/20optimizer_optimizations/if_join_min new file mode 100644 index 0000000..e00c0a5 --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_min @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=3,5,0.5 +F=min(if(x<4, sin(y),cos(y+1)), if(x<4, cos(y),sin(y+1))) +C=fp_less(x,4)!=0 ? fp_min(fp_sin(y),fp_cos(y)) : fp_min(fp_cos(y+1),fp_sin(y+1)) diff --git a/tests/20optimizer_optimizations/if_join_mul b/tests/20optimizer_optimizations/if_join_mul new file mode 100644 index 0000000..bf780ae --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_mul @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=3,5,0.5 +F=if(x<4, sin(y),cos(y+1)) * if(x<4, cos(y),sin(y+1)) +C=fp_less(x,4)!=0 ? (fp_sin(y)*fp_cos(y)) : (fp_cos(y+1)*fp_sin(y+1)) diff --git a/tests/20optimizer_optimizations/if_join_mul2 b/tests/20optimizer_optimizations/if_join_mul2 new file mode 100644 index 0000000..056a18f --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_mul2 @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=x +R=3,5,1 +F=x * 10 * if(x<4, 3,4) +C=x * (fp_less(x,4)!=0 ? 30 : 40) diff --git a/tests/20optimizer_optimizations/if_join_or b/tests/20optimizer_optimizations/if_join_or new file mode 100644 index 0000000..68ed720 --- /dev/null +++ b/tests/20optimizer_optimizations/if_join_or @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=3,5,0.5 +F=if(x<4, sin(y),cos(y+1)) | if(x<4, cos(y),sin(y+1)) +C=fp_less(x,4)!=0 ? fp_or(fp_sin(y),fp_cos(y)) : fp_or(fp_cos(y+1),fp_sin(y+1)) diff --git a/tests/20optimizer_optimizations/ifabs b/tests/20optimizer_optimizations/ifabs new file mode 100644 index 0000000..a0c78db --- /dev/null +++ b/tests/20optimizer_optimizations/ifabs @@ -0,0 +1,21 @@ +T=d ld li f mf gi cd cf cld +V=x +R=-1,1,1 +F= 1*(5+if(x< 0,-x,x)) + \ + 10*(5+if(x<=0,-x,x)) + \ + 100*(5+if(x> 0,-x,x)) + \ + 1000*(5+if(x>=0,-x,x)) + \ + 10000*(5+if(x< 0,x,-x)) + \ + 100000*(5+if(x<=0,x,-x)) + \ + 1000000*(5+if(x> 0,x,-x)) + \ + 10000000*(5+if(x>=0,x,-x)) +C= 1*(5+(fp_less(x, 0)!=0?-x:x)) + \ + 10*(5+(fp_lessOrEq(x, 0)!=0?-x:x)) + \ + 100*(5+(fp_greater(x, 0)!=0?-x:x)) + \ + 1000*(5+(fp_greaterOrEq(x,0)!=0?-x:x)) + \ + 10000*(5+(fp_less(x, 0)!=0?x:-x)) + \ + 100000*(5+(fp_lessOrEq(x, 0)!=0?x:-x)) + \ + 1000000*(5+(fp_greater(x, 0)!=0?x:-x)) + \ + 10000000*(5+(fp_greaterOrEq(x,0)!=0?x:-x)) + +# Expected result: 55555555+10888911*abs(x) diff --git a/tests/20optimizer_optimizations/ifabsnot b/tests/20optimizer_optimizations/ifabsnot new file mode 100644 index 0000000..599e620 --- /dev/null +++ b/tests/20optimizer_optimizations/ifabsnot @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y,z +R=-1,1,0.5 +F=if(!(sin(x)+1.2), y,z) +C=fp_truth(fp_sin(x)+1.2)!=0 ? z:y diff --git a/tests/20optimizer_optimizations/ifconst b/tests/20optimizer_optimizations/ifconst new file mode 100644 index 0000000..19c4577 --- /dev/null +++ b/tests/20optimizer_optimizations/ifconst @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y,z +R=-1,1,0.5 +F=if(1, x,y) + if(0,z,y) +C=x+y+z*0 diff --git a/tests/20optimizer_optimizations/ififconst b/tests/20optimizer_optimizations/ififconst new file mode 100644 index 0000000..4187213 --- /dev/null +++ b/tests/20optimizer_optimizations/ififconst @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=w,x,y,z +R=0,1,1 +F=if(if(x,1,y),z,w) + if(if(w,z,0),x,y) +C=(fp_truth(fp_truth(x)!=0 ? 1 : y)!=0 ? z : w) + (fp_truth(fp_truth(w)!=0 ? z : 0)!=0 ? x : y) diff --git a/tests/20optimizer_optimizations/ifmerge b/tests/20optimizer_optimizations/ifmerge new file mode 100644 index 0000000..9bacd1c --- /dev/null +++ b/tests/20optimizer_optimizations/ifmerge @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=b,d,x,y +R=-1,1,1 +F=if(x,if(y,x,b),if(y,x,d)) + \ + if(b,if(d,y,x),if(d,b,x)) +C=(fp_truth(x)!=0 ? (fp_truth(y)!=0?x:b) : (fp_truth(y)!=0?x:d)) + \ + (fp_truth(b)!=0 ? (fp_truth(d)!=0?y:x) : (fp_truth(d)!=0?b:x)) diff --git a/tests/20optimizer_optimizations/ifmerge2 b/tests/20optimizer_optimizations/ifmerge2 new file mode 100644 index 0000000..37de7f5 --- /dev/null +++ b/tests/20optimizer_optimizations/ifmerge2 @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=a,b,x,y +R=-1,1,1 +F=if(x,if(y,a,b),if(b,a,b)) +C=(fp_truth(x)!=0 ? (fp_truth(y)!=0?a:b) : (fp_truth(b)!=0?a:b)) diff --git a/tests/20optimizer_optimizations/ifmerge2b b/tests/20optimizer_optimizations/ifmerge2b new file mode 100644 index 0000000..d54d357 --- /dev/null +++ b/tests/20optimizer_optimizations/ifmerge2b @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=a,b,x,y +R=-1,1,1 +F=if(x,if(y,a,b),if(b,b,a)) +C=(fp_truth(x)!=0 ? (fp_truth(y)!=0?a:b) : (fp_truth(b)!=0?b:a)) diff --git a/tests/20optimizer_optimizations/ifnop b/tests/20optimizer_optimizations/ifnop new file mode 100644 index 0000000..586f6ac --- /dev/null +++ b/tests/20optimizer_optimizations/ifnop @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=x,y +R=0,1,1 +F=if(x,y,y) +C=x*0+y diff --git a/tests/20optimizer_optimizations/ifnot b/tests/20optimizer_optimizations/ifnot new file mode 100644 index 0000000..a3aa4d6 --- /dev/null +++ b/tests/20optimizer_optimizations/ifnot @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y,z +R=0,1,1 +F=if(!x, y,z) +C=fp_truth(x)!=0 ? z : y diff --git a/tests/20optimizer_optimizations/l_abs b/tests/20optimizer_optimizations/l_abs new file mode 100644 index 0000000..fef54b4 --- /dev/null +++ b/tests/20optimizer_optimizations/l_abs @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-4,4,1 +F=(x+2) & abs(x) & (y+2) +C=fp_and(x+2, fp_and(fp_abs(x), y+2)) diff --git a/tests/20optimizer_optimizations/l_mulabs b/tests/20optimizer_optimizations/l_mulabs new file mode 100644 index 0000000..465fbd7 --- /dev/null +++ b/tests/20optimizer_optimizations/l_mulabs @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-4,4,1 +F=(x*abs(y)) & (y+2) +C=fp_and(x*y*fp_abs(y), y+2) diff --git a/tests/20optimizer_optimizations/l_mulneg b/tests/20optimizer_optimizations/l_mulneg new file mode 100644 index 0000000..5e55817 --- /dev/null +++ b/tests/20optimizer_optimizations/l_mulneg @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-4,4,1 +F=(x*y*-5) & (y+2) +C=fp_and(x*y*-5, y+2) diff --git a/tests/20optimizer_optimizations/l_notnot b/tests/20optimizer_optimizations/l_notnot new file mode 100644 index 0000000..abec0b3 --- /dev/null +++ b/tests/20optimizer_optimizations/l_notnot @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-4,4,1 +F=(x+2) & !!x & (y+2) +C=fp_and(x+2, fp_and(fp_notNot(x), y+2)) diff --git a/tests/20optimizer_optimizations/le_and_eq b/tests/20optimizer_optimizations/le_and_eq new file mode 100644 index 0000000..b13ffe8 --- /dev/null +++ b/tests/20optimizer_optimizations/le_and_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x <= y) & (x = y) +C= x == y diff --git a/tests/20optimizer_optimizations/le_and_ne b/tests/20optimizer_optimizations/le_and_ne new file mode 100644 index 0000000..029cba0 --- /dev/null +++ b/tests/20optimizer_optimizations/le_and_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x <= y) & (x != y) +C= x < y diff --git a/tests/20optimizer_optimizations/le_or_eq b/tests/20optimizer_optimizations/le_or_eq new file mode 100644 index 0000000..41e9649 --- /dev/null +++ b/tests/20optimizer_optimizations/le_or_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x <= y) | (x = y) +C= x <= y diff --git a/tests/20optimizer_optimizations/le_or_ne b/tests/20optimizer_optimizations/le_or_ne new file mode 100644 index 0000000..5d673ec --- /dev/null +++ b/tests/20optimizer_optimizations/le_or_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x <= y) | (x != y) +C= x*0+y*0+ 1 diff --git a/tests/20optimizer_optimizations/lt_and_eq b/tests/20optimizer_optimizations/lt_and_eq new file mode 100644 index 0000000..601c72a --- /dev/null +++ b/tests/20optimizer_optimizations/lt_and_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) & (x = y) +C= x*0+y*0+ 0 diff --git a/tests/20optimizer_optimizations/lt_and_ge b/tests/20optimizer_optimizations/lt_and_ge new file mode 100644 index 0000000..6afe346 --- /dev/null +++ b/tests/20optimizer_optimizations/lt_and_ge @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) & (x >= y) +C= x*0+y*0+ 0 diff --git a/tests/20optimizer_optimizations/lt_and_gt b/tests/20optimizer_optimizations/lt_and_gt new file mode 100644 index 0000000..bc33ed0 --- /dev/null +++ b/tests/20optimizer_optimizations/lt_and_gt @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) & (x > y) +C= x*0+y*0+ 0 diff --git a/tests/20optimizer_optimizations/lt_and_le b/tests/20optimizer_optimizations/lt_and_le new file mode 100644 index 0000000..9d9dc03 --- /dev/null +++ b/tests/20optimizer_optimizations/lt_and_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) & (x <= y) +C= x < y diff --git a/tests/20optimizer_optimizations/lt_and_ne b/tests/20optimizer_optimizations/lt_and_ne new file mode 100644 index 0000000..42574d3 --- /dev/null +++ b/tests/20optimizer_optimizations/lt_and_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) & (x != y) +C= x < y diff --git a/tests/20optimizer_optimizations/lt_or_eq b/tests/20optimizer_optimizations/lt_or_eq new file mode 100644 index 0000000..82e1f7a --- /dev/null +++ b/tests/20optimizer_optimizations/lt_or_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) | (x = y) +C= x <= y diff --git a/tests/20optimizer_optimizations/lt_or_ge b/tests/20optimizer_optimizations/lt_or_ge new file mode 100644 index 0000000..1aaa9c2 --- /dev/null +++ b/tests/20optimizer_optimizations/lt_or_ge @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) | (x >= y) +C= x*0+y*0+ 1 diff --git a/tests/20optimizer_optimizations/lt_or_gt b/tests/20optimizer_optimizations/lt_or_gt new file mode 100644 index 0000000..bed9d85 --- /dev/null +++ b/tests/20optimizer_optimizations/lt_or_gt @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) | (x > y) +C= x != y diff --git a/tests/20optimizer_optimizations/lt_or_le b/tests/20optimizer_optimizations/lt_or_le new file mode 100644 index 0000000..6a413b0 --- /dev/null +++ b/tests/20optimizer_optimizations/lt_or_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) | (x <= y) +C= x <= y diff --git a/tests/20optimizer_optimizations/lt_or_ne b/tests/20optimizer_optimizations/lt_or_ne new file mode 100644 index 0000000..47be08d --- /dev/null +++ b/tests/20optimizer_optimizations/lt_or_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= (x < y) | (x != y) +C= x != y diff --git a/tests/20optimizer_optimizations/lthalf b/tests/20optimizer_optimizations/lthalf new file mode 100644 index 0000000..7d5c494 --- /dev/null +++ b/tests/20optimizer_optimizations/lthalf @@ -0,0 +1,5 @@ +T=d f cd cf +V=x +R=-1,1,0.25 +F=x<if(1,0.5,0) +C=fp_less(x, 0.5) diff --git a/tests/20optimizer_optimizations/mergemulabs b/tests/20optimizer_optimizations/mergemulabs new file mode 100644 index 0000000..4fb6cae --- /dev/null +++ b/tests/20optimizer_optimizations/mergemulabs @@ -0,0 +1,5 @@ +T=d ld f mf li gi cd cf cld +V=x,y,z +R=-1,1,1 +F=abs(x)*abs(y)*z +C=fp_abs(x)*fp_abs(y)*z diff --git a/tests/20optimizer_optimizations/mixedminmax b/tests/20optimizer_optimizations/mixedminmax new file mode 100644 index 0000000..107ba60 --- /dev/null +++ b/tests/20optimizer_optimizations/mixedminmax @@ -0,0 +1,13 @@ +T=d ld li f mf gi cd cf cld +V=x,y,z +R=0,4,1 +F=max(z,min(x,max(max(z,y),x))) + \ + 10*min(z,max(x,min(y,x))) + \ + 100*min(max(x,y),min(y,z)) + \ + 1000*max(min(x,y),max(y,z)) +C=fp_max(z,fp_min(x,fp_max(fp_max(z,y),x))) + \ + 10*fp_min(z,fp_max(x,fp_min(y,x))) + \ + 100*fp_min(fp_max(x,y),fp_min(y,z)) + \ + 1000*fp_max(fp_min(x,y),fp_max(y,z)) + +# Expected optimization: max(x,z) + min(x,z)*10 + min(y,z)*100 + max(y,z)*1000 diff --git a/tests/20optimizer_optimizations/muland2 b/tests/20optimizer_optimizations/muland2 new file mode 100644 index 0000000..be619d5 --- /dev/null +++ b/tests/20optimizer_optimizations/muland2 @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-1,1,0.5 +F=!!x * !!y +C=fp_notNot(x) * fp_notNot(y) diff --git a/tests/20optimizer_optimizations/muland2plus b/tests/20optimizer_optimizations/muland2plus new file mode 100644 index 0000000..0593d8d --- /dev/null +++ b/tests/20optimizer_optimizations/muland2plus @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y,z +R=-1,1,0.5 +F=!!x * !!y * z +C=fp_notNot(x) * fp_notNot(y) * z diff --git a/tests/20optimizer_optimizations/muland3 b/tests/20optimizer_optimizations/muland3 new file mode 100644 index 0000000..52fbe19 --- /dev/null +++ b/tests/20optimizer_optimizations/muland3 @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y,z +R=-1,1,0.5 +F=!!x * !!y * !!z +C=fp_notNot(x) * fp_notNot(y) * fp_notNot(z) diff --git a/tests/20optimizer_optimizations/mulandlt b/tests/20optimizer_optimizations/mulandlt new file mode 100644 index 0000000..d65b0de --- /dev/null +++ b/tests/20optimizer_optimizations/mulandlt @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-1,1,0.5 +F=!!x * (y<0) +C=fp_notNot(x) * Value_t(fp_less(y,0)) diff --git a/tests/20optimizer_optimizations/mulimmlog b/tests/20optimizer_optimizations/mulimmlog new file mode 100644 index 0000000..8dbbfbe --- /dev/null +++ b/tests/20optimizer_optimizations/mulimmlog @@ -0,0 +1,11 @@ +T=d ld f mf cd cf cld +V=x,y +R=0.25, 1, 0.25 +F=log(if(1,5,0)*x*y) +C=fp_log(5*x*y) + +# Expected result: log(x*y) + log(5) + +# Using if(1,5,0) to prevent bytecode optimizer +# from doing this optimization. +# The test subject is fpoptimizer. diff --git a/tests/20optimizer_optimizations/mulnor2 b/tests/20optimizer_optimizations/mulnor2 new file mode 100644 index 0000000..7870f8d --- /dev/null +++ b/tests/20optimizer_optimizations/mulnor2 @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x,y +R=-1,1,0.5 +F=!x * !y +C=fp_not(x) * fp_not(y) + +# Expected result: !(x | y) hence NOR diff --git a/tests/20optimizer_optimizations/mulnor2plus b/tests/20optimizer_optimizations/mulnor2plus new file mode 100644 index 0000000..f4ee408 --- /dev/null +++ b/tests/20optimizer_optimizations/mulnor2plus @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x,y,z +R=-1,1,0.5 +F=!x * !y * z +C=fp_not(x) * fp_not(y) * z + +# Expected result: z * !(x | y) hence NOR diff --git a/tests/20optimizer_optimizations/mulnor3 b/tests/20optimizer_optimizations/mulnor3 new file mode 100644 index 0000000..ef7c83d --- /dev/null +++ b/tests/20optimizer_optimizations/mulnor3 @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x,y,z +R=-1,1,0.5 +F=!x * !y * !z +C=fp_not(x) * fp_not(y) * fp_not(z) + +# Expected result: !(x | y | z) hence NOR diff --git a/tests/20optimizer_optimizations/nand2 b/tests/20optimizer_optimizations/nand2 new file mode 100644 index 0000000..1346b09 --- /dev/null +++ b/tests/20optimizer_optimizations/nand2 @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y +R=0,1,1 +F=!x | !y +C=fp_or(fp_not(x),fp_not(y)) + +# Expected result: !(x & y) hence NAND diff --git a/tests/20optimizer_optimizations/nand2plus b/tests/20optimizer_optimizations/nand2plus new file mode 100644 index 0000000..60ad3eb --- /dev/null +++ b/tests/20optimizer_optimizations/nand2plus @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y,z +R=0,1,1 +F=!x | !y | z +C=fp_or(fp_or(fp_not(x),fp_not(y)),z) + +# Expected result: z | !(x & y) hence NAND diff --git a/tests/20optimizer_optimizations/nand3 b/tests/20optimizer_optimizations/nand3 new file mode 100644 index 0000000..8c7880f --- /dev/null +++ b/tests/20optimizer_optimizations/nand3 @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y,z +R=0,1,1 +F=!x | !y | !z +C=fp_or(fp_or(fp_not(x),fp_not(y)), fp_not(z)) + +# Expected result: !(x & y & z) hence NAND diff --git a/tests/20optimizer_optimizations/negceil b/tests/20optimizer_optimizations/negceil new file mode 100644 index 0000000..50ef9f7 --- /dev/null +++ b/tests/20optimizer_optimizations/negceil @@ -0,0 +1,9 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=ceil(x*(abs(x)-abs(x)-1)) +C=fp_ceil(-x) + + +# abs(x)-abs(x)-1 is used to produce a -1 without +# the bytecode optimizer taking a bite of it diff --git a/tests/20optimizer_optimizations/negcos b/tests/20optimizer_optimizations/negcos new file mode 100644 index 0000000..d5b825e --- /dev/null +++ b/tests/20optimizer_optimizations/negcos @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=cos(x*if(1,-1,0)) +C=fp_cos(-x) diff --git a/tests/20optimizer_optimizations/negcosh b/tests/20optimizer_optimizations/negcosh new file mode 100644 index 0000000..7a44ffb --- /dev/null +++ b/tests/20optimizer_optimizations/negcosh @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=cosh(x*if(1,-1,0)) +C=fp_cosh(-x) diff --git a/tests/20optimizer_optimizations/negfloor b/tests/20optimizer_optimizations/negfloor new file mode 100644 index 0000000..930c95a --- /dev/null +++ b/tests/20optimizer_optimizations/negfloor @@ -0,0 +1,9 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=floor(x*(abs(x)-abs(x)-1)) +C=fp_floor(-x) + + +# abs(x)-abs(x)-1 is used to produce a -1 without +# the bytecode optimizer taking a bite of it diff --git a/tests/20optimizer_optimizations/negsin b/tests/20optimizer_optimizations/negsin new file mode 100644 index 0000000..90b3137 --- /dev/null +++ b/tests/20optimizer_optimizations/negsin @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=sin(x*if(1,-1,0)) +C=fp_sin(-x) diff --git a/tests/20optimizer_optimizations/negsinh b/tests/20optimizer_optimizations/negsinh new file mode 100644 index 0000000..5ec6493 --- /dev/null +++ b/tests/20optimizer_optimizations/negsinh @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,1 +F=sinh(x*if(1,-1,0)) +C=fp_sinh(-x) diff --git a/tests/20optimizer_optimizations/neq0 b/tests/20optimizer_optimizations/neq0 new file mode 100644 index 0000000..2812a0f --- /dev/null +++ b/tests/20optimizer_optimizations/neq0 @@ -0,0 +1,5 @@ +T=d f ld li cd cf cld +V=x +R=0,1,1 +F=(x!=if(1,0,0)) + (if(1,0,0)!=x) +C=(fp_nequal(x,0)) + (fp_nequal(0,x)) diff --git a/tests/20optimizer_optimizations/neq1 b/tests/20optimizer_optimizations/neq1 new file mode 100644 index 0000000..3d551ae --- /dev/null +++ b/tests/20optimizer_optimizations/neq1 @@ -0,0 +1,6 @@ +T=d f ld li cd cf cld +V=x +R=0,1,1 +F=(!x!=if(1,1,1)) +C=fp_nequal(fp_not(x),1) + diff --git a/tests/20optimizer_optimizations/nor2 b/tests/20optimizer_optimizations/nor2 new file mode 100644 index 0000000..1610185 --- /dev/null +++ b/tests/20optimizer_optimizations/nor2 @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y +R=0,1,1 +F=!x & !y +C=fp_and(fp_not(x),fp_not(y)) + +# Expected result: !(x | y) hence NOR diff --git a/tests/20optimizer_optimizations/nor2plus b/tests/20optimizer_optimizations/nor2plus new file mode 100644 index 0000000..76f8f97 --- /dev/null +++ b/tests/20optimizer_optimizations/nor2plus @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y,z +R=0,1,1 +F=!x & !y & z +C=fp_and(fp_and(fp_not(x),fp_not(y)),z) + +# Expected result: z & !(x | y) hence NOR diff --git a/tests/20optimizer_optimizations/nor3 b/tests/20optimizer_optimizations/nor3 new file mode 100644 index 0000000..fdce04e --- /dev/null +++ b/tests/20optimizer_optimizations/nor3 @@ -0,0 +1,7 @@ +T=d ld f mf li gi cd cf cld +V=x,y,z +R=0,1,1 +F=!x & !y & !z +C=fp_and(fp_and(fp_not(x),fp_not(y)), fp_not(z)) + +# Expected result: !(x | y | z) hence NOR diff --git a/tests/20optimizer_optimizations/not_eq b/tests/20optimizer_optimizations/not_eq new file mode 100644 index 0000000..5f47e96 --- /dev/null +++ b/tests/20optimizer_optimizations/not_eq @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= if(x = y, 0,1) +C= x != y diff --git a/tests/20optimizer_optimizations/not_ge b/tests/20optimizer_optimizations/not_ge new file mode 100644 index 0000000..f6ef4d6 --- /dev/null +++ b/tests/20optimizer_optimizations/not_ge @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= if(x >= y, 0,1) +C= x < y diff --git a/tests/20optimizer_optimizations/not_gt b/tests/20optimizer_optimizations/not_gt new file mode 100644 index 0000000..beeeffa --- /dev/null +++ b/tests/20optimizer_optimizations/not_gt @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= if(x > y, 0,1) +C= x <= y diff --git a/tests/20optimizer_optimizations/not_le b/tests/20optimizer_optimizations/not_le new file mode 100644 index 0000000..7d5b689 --- /dev/null +++ b/tests/20optimizer_optimizations/not_le @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= if(x <= y, 0,1) +C= x > y diff --git a/tests/20optimizer_optimizations/not_lt b/tests/20optimizer_optimizations/not_lt new file mode 100644 index 0000000..6955276 --- /dev/null +++ b/tests/20optimizer_optimizations/not_lt @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= if(x < y, 0,1) +C= x >= y diff --git a/tests/20optimizer_optimizations/not_ne b/tests/20optimizer_optimizations/not_ne new file mode 100644 index 0000000..ceb2ca6 --- /dev/null +++ b/tests/20optimizer_optimizations/not_ne @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=0,1,1 +F= if(x != y, 0,1) +C= x == y diff --git a/tests/20optimizer_optimizations/notnot b/tests/20optimizer_optimizations/notnot new file mode 100644 index 0000000..ce4f5d7 --- /dev/null +++ b/tests/20optimizer_optimizations/notnot @@ -0,0 +1,5 @@ +T=d ld li f mf gi cd cf cld +V=x,y +R=-2,2,1 +F=!!x + if(y, 1,0) +C=fp_truth(x) + fp_truth(y) diff --git a/tests/20optimizer_optimizations/posnot b/tests/20optimizer_optimizations/posnot new file mode 100644 index 0000000..b6db77e --- /dev/null +++ b/tests/20optimizer_optimizations/posnot @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,0.5 +F=!(sin(x) + 1.2) +C=fp_not(fp_sin(x) + 1.2) + +# Expected optimization: produce cAbsNot diff --git a/tests/20optimizer_optimizations/posnotnot b/tests/20optimizer_optimizations/posnotnot new file mode 100644 index 0000000..737e583 --- /dev/null +++ b/tests/20optimizer_optimizations/posnotnot @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,0.5 +F=!!(sin(x) + 1.2) +C=fp_notNot(fp_sin(x) + 1.2) + +# Expected optimization: produce cAbsNotNot diff --git a/tests/20optimizer_optimizations/powimmaddimmlog b/tests/20optimizer_optimizations/powimmaddimmlog new file mode 100644 index 0000000..f51b94b --- /dev/null +++ b/tests/20optimizer_optimizations/powimmaddimmlog @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x +R=0.25, 1, 0.25 +F=pow(5, log(x)+1) +C=fp_pow(5, fp_log(x)+1) + +# Expected result: 5^1 * x^log(5) diff --git a/tests/20optimizer_optimizations/powimmlog b/tests/20optimizer_optimizations/powimmlog new file mode 100644 index 0000000..40def8e --- /dev/null +++ b/tests/20optimizer_optimizations/powimmlog @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x +R=0.25, 2, 0.25 +F=pow(3, log(x)) + pow(5, log(x)*sin(x)) +C=fp_pow(3, fp_log(x)) + fp_pow(5, fp_log(x)*fp_sin(x)) + +# Expected result: pow(x, log(3)) + pow(x, log(3)*sin(x)) diff --git a/tests/20optimizer_optimizations/powmulimm_fnen b/tests/20optimizer_optimizations/powmulimm_fnen new file mode 100644 index 0000000..3f6c6db --- /dev/null +++ b/tests/20optimizer_optimizations/powmulimm_fnen @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-3,3,2 +F=((-5.1)*x*y)^(-8) +C=fp_pow((-5.1)*x*y, (-8)) diff --git a/tests/20optimizer_optimizations/powmulimm_fnep b/tests/20optimizer_optimizations/powmulimm_fnep new file mode 100644 index 0000000..39f70f7 --- /dev/null +++ b/tests/20optimizer_optimizations/powmulimm_fnep @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-3,3,1 +F=((-5.1)*x*y)^(4) +C=fp_pow((-5.1)*x*y, (4)) diff --git a/tests/20optimizer_optimizations/powmulimm_fnfn b/tests/20optimizer_optimizations/powmulimm_fnfn new file mode 100644 index 0000000..2ab6361 --- /dev/null +++ b/tests/20optimizer_optimizations/powmulimm_fnfn @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x +R=-3,-1,0.5 +F=((-5.1)*x)^(-7.1) +C=fp_pow((-5.1)*x, (-7.1)) diff --git a/tests/20optimizer_optimizations/powmulimm_fnfp b/tests/20optimizer_optimizations/powmulimm_fnfp new file mode 100644 index 0000000..35d1b5f --- /dev/null +++ b/tests/20optimizer_optimizations/powmulimm_fnfp @@ -0,0 +1,5 @@ +T=d ld f mf cd cf cld +V=x,y +R=-3,3,1 +F=((-5.1)*x*y)^7.1 +C=fp_pow((-5.1)*x*y, 7.1) diff --git a/tests/20optimizer_optimizations/powmulimm_fpfp b/tests/20optimizer_optimizations/powmulimm_fpfp new file mode 100644 index 0000000..c1eedb3 --- /dev/null +++ b/tests/20optimizer_optimizations/powmulimm_fpfp @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x,y +R=-3,3,1 +F=(5.1*x*y)^7.1 +C=fp_pow(5.1*x*y, 7.1) + +# Expected result: 5.1^7.1 * (x*y)^7.1 diff --git a/tests/20optimizer_optimizations/sub1cos2 b/tests/20optimizer_optimizations/sub1cos2 new file mode 100644 index 0000000..096ac09 --- /dev/null +++ b/tests/20optimizer_optimizations/sub1cos2 @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,0.5 +F=1-cos(x)^2 +C=1 - fp_pow(fp_cos(x),2) + +# Expected optimization: sin(x)^2 diff --git a/tests/20optimizer_optimizations/sub1sin2 b/tests/20optimizer_optimizations/sub1sin2 new file mode 100644 index 0000000..fa48e2b --- /dev/null +++ b/tests/20optimizer_optimizations/sub1sin2 @@ -0,0 +1,7 @@ +T=d ld f mf cd cf cld +V=x +R=-1,1,0.5 +F=1-sin(x)^2 +C=1 - fp_pow(fp_sin(x),2) + +# Expected optimization: cos(x)^2 diff --git a/tests/20optimizer_optimizations/trig_modulo b/tests/20optimizer_optimizations/trig_modulo new file mode 100644 index 0000000..468421a --- /dev/null +++ b/tests/20optimizer_optimizations/trig_modulo @@ -0,0 +1,35 @@ +T=d ld f mf cd cf cld +V=x +R=-9.42477796076937971538793014983850865259,9.42477796076937971538793014983850865259,0.785398163397448309615660845819875721049292349 +F=cos(x+pi) + cos(x+pi*2/3) + cos(x+pi*5/2) + cos(x+pi*6/2) + cos(x+pi*7/2) + \ + sin(x+pi) + sin(x+pi*2/3) + sin(x+pi*5/2) + sin(x+pi*6/2) + sin(x+pi*7/2) + \ + cos(x-pi) + cos(x-pi*2/3) + cos(x-pi*5/2) + cos(x-pi*6/2) + cos(x-pi*7/2) + \ + sin(x-pi) + sin(x-pi*2/3) + sin(x-pi*5/2) + sin(x-pi*6/2) + sin(x-pi*7/2) +C=fp_cos(x+fp_const_pi<Value_t>()) + \ + fp_cos(x+fp_const_pi<Value_t>()*2/3) + \ + fp_cos(x+fp_const_pi<Value_t>()*5/2) + \ + fp_cos(x+fp_const_pi<Value_t>()*6/2) + \ + fp_cos(x+fp_const_pi<Value_t>()*7/2) + \ + fp_sin(x+fp_const_pi<Value_t>()) + \ + fp_sin(x+fp_const_pi<Value_t>()*2/3) + \ + fp_sin(x+fp_const_pi<Value_t>()*5/2) + \ + fp_sin(x+fp_const_pi<Value_t>()*6/2) + \ + fp_sin(x+fp_const_pi<Value_t>()*7/2) + \ + fp_cos(x-fp_const_pi<Value_t>()) + \ + fp_cos(x-fp_const_pi<Value_t>()*2/3) + \ + fp_cos(x-fp_const_pi<Value_t>()*5/2) + \ + fp_cos(x-fp_const_pi<Value_t>()*6/2) + \ + fp_cos(x-fp_const_pi<Value_t>()*7/2) + \ + fp_sin(x-fp_const_pi<Value_t>()) + \ + fp_sin(x-fp_const_pi<Value_t>()*2/3) + \ + fp_sin(x-fp_const_pi<Value_t>()*5/2) + \ + fp_sin(x-fp_const_pi<Value_t>()*6/2) + \ + fp_sin(x-fp_const_pi<Value_t>()*7/2) + +# Expected optimization: +# cos(x + pi*2/3) +# + cos(x - pi*2/3) +# + sin(x - pi*2/3) +# + sin(x + pi*2/3) +# - 4*sin(x) +# - 4*cos(x) diff --git a/tests/20optimizer_optimizations/trunc_from_if b/tests/20optimizer_optimizations/trunc_from_if new file mode 100644 index 0000000..68bff0d --- /dev/null +++ b/tests/20optimizer_optimizations/trunc_from_if @@ -0,0 +1,12 @@ +T=d ld f mf cd cf cld +V=x +R=-3,3,0.25 +F=if(x>0, floor(x),ceil(x))+\ + if(x>=0, floor(x),ceil(x))+\ + if(x<0, ceil(x),floor(x))+\ + if(x<=0, ceil(x),floor(x))+\ + 10*if(x>0, ceil(x),floor(x))+\ + 10*if(x>=0, ceil(x),floor(x))+\ + 10*if(x<0, floor(x),ceil(x))+\ + 10*if(x<=0, floor(x),ceil(x)) +C=fp_trunc(x)*4 + 40*(x>0?fp_ceil(x):fp_floor(x)) diff --git a/tests/20optimizer_optimizations/xaddnot b/tests/20optimizer_optimizations/xaddnot new file mode 100644 index 0000000..9ab0426 --- /dev/null +++ b/tests/20optimizer_optimizations/xaddnot @@ -0,0 +1,5 @@ +T=d f ld li gi cd cf cld +V=x +R=-5,5,1 +F=!(x+if(1,4,4)) +C=fp_not(x+4) diff --git a/tests/20optimizer_optimizations/xaddnotnot b/tests/20optimizer_optimizations/xaddnotnot new file mode 100644 index 0000000..cf096ec --- /dev/null +++ b/tests/20optimizer_optimizations/xaddnotnot @@ -0,0 +1,5 @@ +T=d f ld li gi cd cf cld +V=x +R=-5,5,1 +F=!!(x+if(1,4,4)) +C=fp_notNot(x+4) diff --git a/tests/21optimizer_trigcombinations/README b/tests/21optimizer_trigcombinations/README new file mode 100644 index 0000000..e44c9ce --- /dev/null +++ b/tests/21optimizer_trigcombinations/README @@ -0,0 +1 @@ +Moved into testbed code. diff --git a/tests/21optimizer_trigcombinations/make.php b/tests/21optimizer_trigcombinations/make.php new file mode 100644 index 0000000..c4239b1 --- /dev/null +++ b/tests/21optimizer_trigcombinations/make.php @@ -0,0 +1,80 @@ +<?php + +function CreateTest($f, $file) +{ + $F = $f; + $C = preg_replace('/(sinh?|cosh?|tanh?|pow|exp)/', 'fp_$1', $f); + + $vars = Array('x'); + #if(strpos($f, '(x)') !== false) $vars[] = 'x'; + #if(strpos($f, '(y)') !== false) $vars[] = 'y'; + + print "$F\n"; + +/* file_put_contents($file, + "T=d\n". + "V=".join(',', $vars)."\n". + "R=-4,4,0.5\n". + "F= $F\n". + "C= $C\n");*/ +} + +$functions = Array('sin','cos','tan','sinh','cosh','tanh','exp'); + +for($operator=0; $operator<2; ++$operator) +for($a=0; $a<7; ++$a) + for($b=$a+1; $b<7; ++$b) + { + $f1 = $functions[$a]; + $f2 = $functions[$b]; + + for($ae=-2; $ae<=2; ++$ae) + for($be=-2; $be<=2; ++$be) + { + if($be == 0 && $ae == 1) continue; // testing the function alone is not very cool + if($ae == 0 && $be == 1) continue; // testing the function alone is not very cool + + if($a < 3 && $f2=='exp') continue; // don't bother mixing exp with sin/cos/tan + if($b < 3 && $f1=='exp') continue; // don't bother mixing exp with sin/cos/tan + + if(!$ae && !$be) continue; + + $afunc = "$f1(x)"; + if($ae == 0) $afunc = "1"; + elseif($ae != 1) $afunc = "pow($afunc,{$ae}.0)"; + + $func = $afunc; + + if($be < 0 && $operator==0) + { + $func .= " / "; + + $bfunc = "$f2(x)"; + if($be == -1) {} + else $bfunc = "pow($bfunc,".(-$be).".0)"; + $func .= $bfunc; + } + else if($be != 0) + { + $func .= ($operator==0 ? " * " : " + "); + + $bfunc = "$f2(x)"; + if($be == 1) {} + else $bfunc = "pow($bfunc,{$be}.0)"; + $func .= $bfunc; + } + + static $counter = 0; + ++$counter; + $name = $counter; + #$op = $operator?'add':'mul'; + #$name = sprintf('%s_%sp%d_%sp%d', $op,$f1,$ae,$f2,$be); + + CreateTest($func, $name); + if(preg_match('/h\(/', $func)) + { + CreateTest(str_replace('(x)', '(x*x)', $func), + ++$counter); + } + } + } diff --git a/tests/50regressions/1 b/tests/50regressions/1 new file mode 100644 index 0000000..217457e --- /dev/null +++ b/tests/50regressions/1 @@ -0,0 +1,7 @@ +# Bug fixed in release version 2.84 + +T=d f ld mf li gi +V=x +R=-10,10,1 +F=x+max(0, min(-2,0)) +C=x+fp_max(0, fp_min(-2,0)) diff --git a/tests/50regressions/10 b/tests/50regressions/10 new file mode 100644 index 0000000..13eac2b --- /dev/null +++ b/tests/50regressions/10 @@ -0,0 +1,6 @@ +# Fixed in commit faae669a9ff6e5557437ab0cd9ce108e27ca5763 +T=d f ld +V=x +R=1,10,1 +F=1/abs(x)<1 +C=1/fp_abs(x)<1 diff --git a/tests/50regressions/11 b/tests/50regressions/11 new file mode 100644 index 0000000..df9aa25 --- /dev/null +++ b/tests/50regressions/11 @@ -0,0 +1,6 @@ +# Fixed in commit 055f1dda1331e8c17829f9651d6052eddc1f61ba +T=d f ld +V=x +R=1e25,10e25,1e25 +F=exp(x/5e+25) +C=fp_exp(x/5e+25) diff --git a/tests/50regressions/2 b/tests/50regressions/2 new file mode 100644 index 0000000..4c6795e --- /dev/null +++ b/tests/50regressions/2 @@ -0,0 +1,7 @@ +# Bug fixed in commit 933cb4b9499535eb2718193897326811e62829a6 + +T=d f ld mf li gi +V=x +R=-10,10,1 +F=min(x,min(1,x)) +C=fp_min(x,fp_min(1,x)) diff --git a/tests/50regressions/3 b/tests/50regressions/3 new file mode 100644 index 0000000..6a7b330 --- /dev/null +++ b/tests/50regressions/3 @@ -0,0 +1,9 @@ +# Bug fixed in commit 6a5cf0e5cbdf96464b17b9784c2b2fd9ff2bd3b9 +# !x & !!x should be 0, became !!x + +T=d f ld mf li gi +V=x +R=-2, 2, 1 +F=sub( (!x & !!x) , (!x | !!x) ) +#C=-1 +C=userDefFuncSub({ fp_and(fp_not(x), fp_notNot(x)), fp_or(fp_not(x), fp_notNot(x)) }) diff --git a/tests/50regressions/36 b/tests/50regressions/36 new file mode 100644 index 0000000..9ba8c4d --- /dev/null +++ b/tests/50regressions/36 @@ -0,0 +1,7 @@ +# See "What's new in v3.0.3" for this regression + +T=d f ld mf li gi +V=x +R=-10,10,1 +F=-if(x<0, x, -x) + -if(x<5, 2, 3) +C=-(x<0 ? x : -x) + -(x<5 ? 2 : 3) diff --git a/tests/50regressions/4 b/tests/50regressions/4 new file mode 100644 index 0000000..8a6196d --- /dev/null +++ b/tests/50regressions/4 @@ -0,0 +1,9 @@ +# Bug fixed in commit d0c31571026723d9c5852a4de33bc7a616a4943e +# sub(!(x-y), !!(x-y)) bugs when double-optimized +# due to buggy CopyOnWrite calling in cSub/cRSub reconstruction + +T=d f ld mf li gi +V=x,y +R=-2, 2, 1 +F=sub(!(x-y), !!(x-y)) +C=userDefFuncSub({ fp_not(x-y), fp_notNot(x-y) }) diff --git a/tests/50regressions/42 b/tests/50regressions/42 new file mode 100644 index 0000000..17e284e --- /dev/null +++ b/tests/50regressions/42 @@ -0,0 +1,7 @@ +# See "What's new in v3.2" for this regression. hypot() is unrelated. + +T=d f ld mf +V=x,y +R=-3,3,.25 +F=sqrt(x*x) + 1.5*((y*y)^.25) + hypot(x,y) +C=fp_sqrt(x*x) + 1.5*(fp_pow(y*y, 0.25)) + fp_hypot(x,y) diff --git a/tests/50regressions/5 b/tests/50regressions/5 new file mode 100644 index 0000000..4e09739 --- /dev/null +++ b/tests/50regressions/5 @@ -0,0 +1,9 @@ +# sin/cos/tan/csc/sec/cot CSE bugs +# Introduced in commit 62b869dd21c1c7fe7ec4fcd846c9e9c12a27a34a +# Fixed in commit b887b5a13b0ca689c208fb01072ac353a048797c + +T=d f ld mf +V=x +R=-0.7, 0.7, 0.28 +F=sub(sin(x)+csc(x),cos(x)) +C=userDefFuncSub({fp_sin(x)+1/fp_sin(x),fp_cos(x)}) diff --git a/tests/50regressions/51 b/tests/50regressions/51 new file mode 100644 index 0000000..a4e9fd2 --- /dev/null +++ b/tests/50regressions/51 @@ -0,0 +1,7 @@ +# See "What's new in v3.2.1" for this regression. + +T=d f ld mf +V=x +R=-100, -1, .5 +F=log(-x) +C=fp_log(-x) diff --git a/tests/50regressions/57 b/tests/50regressions/57 new file mode 100644 index 0000000..bc6bb8c --- /dev/null +++ b/tests/50regressions/57 @@ -0,0 +1,7 @@ +# See "What's new in v4.0.2" for this regression. + +T=d f ld mf +V=x +R=.05, 1.0, .01 +F=cosh(asinh(x)) +C=fp_cosh(fp_asinh(x)) diff --git a/tests/50regressions/59 b/tests/50regressions/59 new file mode 100644 index 0000000..c500899 --- /dev/null +++ b/tests/50regressions/59 @@ -0,0 +1,7 @@ +# See "What's new in v4.0.3" for this regression. + +T=d f ld mf +V=x,y +R=-2, 2, 1.2 +F=cosh(x^2) + tanh(y^2) +C=fp_cosh(x*x) + fp_tanh(y*y) diff --git a/tests/50regressions/6 b/tests/50regressions/6 new file mode 100644 index 0000000..5a9ca87 --- /dev/null +++ b/tests/50regressions/6 @@ -0,0 +1,8 @@ +# Bug: !(x+4) fails on integer types +# Introduced in commit ________ +# Fixed in commit 6461cac2dab474ea091befd3782717ccd573b385 +T=d li gi +V=x +R=-5,5,1 +F=sub(!(x+4), !!(x+3)) +C=userDefFuncSub({fp_not(x+4), fp_notNot(x+3)}) diff --git a/tests/50regressions/60 b/tests/50regressions/60 new file mode 100644 index 0000000..d8244bd --- /dev/null +++ b/tests/50regressions/60 @@ -0,0 +1,7 @@ +# Bug fixed in release version 4.0.4 + +T=d f ld mf li gi +V=x,y +R=-2, 2, 1 +F=sqr(x) | sub(x,y) | value() +C=fp_or(fp_or(userDefFuncSqr({x}), userDefFuncSub({x,y})), userDefFuncValue({})) diff --git a/tests/50regressions/61 b/tests/50regressions/61 new file mode 100644 index 0000000..cf5b4c7 --- /dev/null +++ b/tests/50regressions/61 @@ -0,0 +1,11 @@ +# Bug: positiveinteger*terms1 + -sameinteger*terms2 incorrectly ungroups the terms in terms1 +# Fixed in commit 11d99dabc69750b8ac232570b3e523b026c51a2a + +T=f d li +V=x,y,z +R=-3,3,2 +F=5*x*y + -5*z +C=5*x*y + -5*z + +# Expected result: (x*y-z)*5 +# Erroneous result: ((x+y)-z)*5 diff --git a/tests/50regressions/7 b/tests/50regressions/7 new file mode 100644 index 0000000..b5b5776 --- /dev/null +++ b/tests/50regressions/7 @@ -0,0 +1,9 @@ +# Bug: x>7 & x<2 (which should produce 0) was wrongly optimized +# with the same rule that works for e.g. x>7 & x<13 +# Introduced in commit ________ +# Fixed in commit e42268a289f256104c01c15873f2d63eac3a95b2 +T=d li +V=x +R=-9,9,1 +F=x>7 & x<2 +C=x-x diff --git a/tests/50regressions/8 b/tests/50regressions/8 new file mode 100644 index 0000000..4b41b45 --- /dev/null +++ b/tests/50regressions/8 @@ -0,0 +1,8 @@ +# Bug: atan2(-x,-y) wrongly optimized to atan2(x,y) +# Introduced in commit ff12195f506cb3138067ee0e467ead97cdaca322 +# Fixed in commit 907b889a93e4b93b0dc501fb904f471744c779e4 +T=d f +V=x,y +R=-9,9,1 +F=atan2(-x,-y) + 10*atan2(-x,y) + 20*atan2(x,-y) + 30*atan2(x,y) +C=fp_atan2(-x,-y) + 10*fp_atan2(-x,y) + 20*fp_atan2(x,-y) + 30*fp_atan2(x,y) diff --git a/tests/50regressions/9a b/tests/50regressions/9a new file mode 100644 index 0000000..9ddf3d4 --- /dev/null +++ b/tests/50regressions/9a @@ -0,0 +1,8 @@ +# Bug: a:=x;a*0 begets a half cFetch opcode +# Introduced in commit 547195b5f155cf7a706e3a5cca796e9cb7d33c38 +# Fixed in commit 7146fbe79611e0a6bb77ff983448fa23909336c6 +T=d li +V=x +R=-1,1,1 +F=a:=x;a*0 +C=x*0 diff --git a/tests/50regressions/9b b/tests/50regressions/9b new file mode 100644 index 0000000..58b34e7 --- /dev/null +++ b/tests/50regressions/9b @@ -0,0 +1,8 @@ +# Bug: fCall + multiplication by zero begets a broken opcode +# Introduced in commit 547195b5f155cf7a706e3a5cca796e9cb7d33c38 +# Fixed in commit 7146fbe79611e0a6bb77ff983448fa23909336c6 +T=d li +V=a,b +R=-1,1,1 +F=sub(a,b)*0 +C=(a-b)*0 diff --git a/tests/50regressions/9c b/tests/50regressions/9c new file mode 100644 index 0000000..e47c648 --- /dev/null +++ b/tests/50regressions/9c @@ -0,0 +1,8 @@ +# Bug: pCall + multiplication by zero begets a broken opcode +# Introduced in commit 547195b5f155cf7a706e3a5cca796e9cb7d33c38 +# Fixed in commit 7146fbe79611e0a6bb77ff983448fa23909336c6 +T=d li +V=a,b +R=-1,1,1 +F=psub(a,b)*0 +C=(a-b)*0 diff --git a/tests/50regressions/9d b/tests/50regressions/9d new file mode 100644 index 0000000..6468041 --- /dev/null +++ b/tests/50regressions/9d @@ -0,0 +1,8 @@ +# Bug: pIf + multiplication by zero begets a broken opcode +# Introduced in commit 547195b5f155cf7a706e3a5cca796e9cb7d33c38 +# Fixed in commit 7146fbe79611e0a6bb77ff983448fa23909336c6 +T=d li +V=a,b +R=-1,1,1 +F=if(a,b*0,a*0)*0 +C=a*b*0 diff --git a/tests/99misc/1 b/tests/99misc/1 new file mode 100644 index 0000000..27eb69b --- /dev/null +++ b/tests/99misc/1 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1000,1000,.25 +F=x*4/2 + (1+(2+3)) + x*x+x+1+2+3*4+5*6*\n7-8*9 +C=x*4/2 + (1+(2+3)) + x*x+x+(1.0+2.0+3.0*4.0+5.0*6.0*7.0-8.0*9.0) diff --git a/tests/99misc/10 b/tests/99misc/10 new file mode 100644 index 0000000..24ebd0a --- /dev/null +++ b/tests/99misc/10 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y,z +R=1,4,.3 +F=1+sin(cos(max(1+2+3+4+5, x+y+z)))+2 +C=1+fp_sin(fp_cos( fp_max(1+2+3+4+5, x+y+z)))+2 diff --git a/tests/99misc/11 b/tests/99misc/11 new file mode 100644 index 0000000..c34f0a8 --- /dev/null +++ b/tests/99misc/11 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y,z +R=1,19,.8 +F=-(-(-(-(-x))-x))+y*1+log(1.1^z) +C=(-x-x)+y+fp_log(fp_pow(1.1, z)) diff --git a/tests/99misc/12 b/tests/99misc/12 new file mode 100644 index 0000000..15942f0 --- /dev/null +++ b/tests/99misc/12 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=1,2000,.5 +F=1/log(10^((3-2)/log(x))) +C=1.0/fp_log(fp_pow(10.0, 1.0/fp_log(x))) diff --git a/tests/99misc/13 b/tests/99misc/13 new file mode 100644 index 0000000..08540a8 --- /dev/null +++ b/tests/99misc/13 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-30,30,.5 +F=x^3 * x^4 + y^3 * y^5 +C=fp_pow(x,3) * fp_pow(x,4) + fp_pow(y,3) * fp_pow(y,5) diff --git a/tests/99misc/14 b/tests/99misc/14 new file mode 100644 index 0000000..83f6ce0 --- /dev/null +++ b/tests/99misc/14 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-50,50,.1 +F=x*pi + sin(2*pi) + CONST +C=x*fp_const_pi<Value_t>() + fp_sin(2*fp_const_pi<Value_t>()) + Value_t(CONST) diff --git a/tests/99misc/15 b/tests/99misc/15 new file mode 100644 index 0000000..b24072f --- /dev/null +++ b/tests/99misc/15 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=1.1, 6, .07 +F=x^y/log(y) + log(x)/log(y) + log(x^y) +C=fp_pow(x,y)/fp_log(y) + fp_log(x)/fp_log(y) + fp_log(fp_pow(x,y)) diff --git a/tests/99misc/16 b/tests/99misc/16 new file mode 100644 index 0000000..02736f4 --- /dev/null +++ b/tests/99misc/16 @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x,y +R=-20, 20, 1 +F=if(x<0, if(y<0, x+y, x-y), if(y>0, x*y, x+2*y)) +C=x<0 ? (y<0 ? x+y : x-y) : (y>0 ? x*y : x+2*y) diff --git a/tests/99misc/17 b/tests/99misc/17 new file mode 100644 index 0000000..88c3de7 --- /dev/null +++ b/tests/99misc/17 @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x,y +R=-20, 20, 1 +F=sqr(x)+sub(x,y)+psqr(y)+psub(y+1,x-2)-1 +C=userDefFuncSqr({x})+userDefFuncSub({x,y})+userDefFuncSqr({y})+userDefFuncSub({y+1,x-2})-1 diff --git a/tests/99misc/18 b/tests/99misc/18 new file mode 100644 index 0000000..dfb776f --- /dev/null +++ b/tests/99misc/18 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=1,17,.2 +F= - ( - ( - ( - 5 ) ) ) * -x^ -y^-2 +C=- ( - ( - ( - 5 ) ) ) * -fp_pow(x, -fp_pow(y, -2)) diff --git a/tests/99misc/19 b/tests/99misc/19 new file mode 100644 index 0000000..fbabe3e --- /dev/null +++ b/tests/99misc/19 @@ -0,0 +1,17 @@ +T=d f ld mf li gi +V=x,y +R=-100,100,1 +F=(x<y)+10*(x<=y)+100*(x>y)+1000*(x>=y)+10000*(x=y)+100000*(x!=y)+ \ + (x&y)*2+(x|y)*20+(!x)*200+(!!x)*2000+4*!((x<y)&(x<3))+40*!!(!(x>y)|(x>3)) +C= fp_less(x,y)+\ + 10*fp_lessOrEq(x,y)+\ + 100*fp_greater(x,y)+\ + 1000*fp_greaterOrEq(x,y)+\ + 10000*fp_equal(x,y)+\ + 100000*fp_nequal(x,y) \ + +fp_and(x,y)*2 \ + +fp_or(x,y)*20 \ + +fp_not(x)*200 \ + +fp_truth(x)*2000 \ + +4*fp_not(fp_and(fp_less(x,y), fp_less(x,3))) \ + +40*fp_or(fp_not(fp_greater(x,y)), fp_greater(x,3)) diff --git a/tests/99misc/2 b/tests/99misc/2 new file mode 100644 index 0000000..1f029bb --- /dev/null +++ b/tests/99misc/2 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1000,1000,.1 +F= 2 * x+ sin ( x ) / .5 + 2-sin(x)*sin(x) +C=2 * x + fp_sin(x)/.5 + 2-fp_sin(x)*fp_sin(x) diff --git a/tests/99misc/20 b/tests/99misc/20 new file mode 100644 index 0000000..ff89452 --- /dev/null +++ b/tests/99misc/20 @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x,y +R=-100,100,1 +F=(!(x != y) & !x) + !(!(!(!y))) +C=fp_and(fp_not<Value_t>(x != y), fp_not(x)) + fp_truth(y) diff --git a/tests/99misc/21 b/tests/99misc/21 new file mode 100644 index 0000000..faa73fa --- /dev/null +++ b/tests/99misc/21 @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x +R=-10,10,1 +F=sqr(x)+value()-pvalue ( ) +C=userDefFuncSqr({x})+userDefFuncValue({})-5 diff --git a/tests/99misc/22 b/tests/99misc/22 new file mode 100644 index 0000000..2d38405 --- /dev/null +++ b/tests/99misc/22 @@ -0,0 +1,11 @@ +T=d ld mf +V=x,y +R=-4,4,.1 + +# This function is too complex for "float" accuracy + +F=3.5doubled + 10*x tripled - sin(y)doubled + \ + 100*(x doubled-y tripled)doubled + 5/2doubled + 1.1^x doubled + \ + 1.1doubled^x doubled +C=(3.5*2) + 10*(x*3) - (fp_sin(y)*2) + 100*((x*2)-(y*3))*2 + 5.0/(2*2) + \ + fp_pow(1.1, x*2) + fp_pow(1.1*2, x*2) diff --git a/tests/99misc/23 b/tests/99misc/23 new file mode 100644 index 0000000..eb87ad5 --- /dev/null +++ b/tests/99misc/23 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-1000,1000,.1 +F=(x/(2*acos(0)))*180 +C=(x/(2*fp_acos(0.0)))*180 diff --git a/tests/99misc/24 b/tests/99misc/24 new file mode 100644 index 0000000..a8bba35 --- /dev/null +++ b/tests/99misc/24 @@ -0,0 +1,7 @@ +# Note: Contains a duplicate of regressions 1 and 2 + +T=d f ld mf li gi +V=x +R=-1000,1000,1 +F=(min(x, min(1,x)) + min(x, 1))/2 + min(x, 1)*3 + max(0, min(-2,0)) +C=(fp_min(x, fp_min(1,x)) + fp_min(x, 1))/2 + fp_min(x, 1)*3 + fp_max(0, fp_min(-2,0)) diff --git a/tests/99misc/25 b/tests/99misc/25 new file mode 100644 index 0000000..8c9a122 --- /dev/null +++ b/tests/99misc/25 @@ -0,0 +1,5 @@ +T=d f ld mf +V=a,b,c +R=1,3,.2 +F=a^b^c + a^-2 * (-b^2) + (-b^-c) +C=fp_pow(a, fp_pow(b, c)) + fp_pow(a, -2) * (-fp_pow(b, 2)) + (-fp_pow(b, -c)) diff --git a/tests/99misc/26_deg b/tests/99misc/26_deg new file mode 100644 index 0000000..c2945a3 --- /dev/null +++ b/tests/99misc/26_deg @@ -0,0 +1,6 @@ +T=d f ld mf +DEG=1 +V=x +R=-100,100,.1 +F=sin(x) + cos(x*1.5) + asin(x/110) + acos(x/120) +C=fp_sin(d2r(x)) + fp_cos(d2r(x*1.5)) + r2d(fp_asin(x/110.0)) + r2d(fp_acos(x/120.0)) diff --git a/tests/99misc/27 b/tests/99misc/27 new file mode 100644 index 0000000..276b2bb --- /dev/null +++ b/tests/99misc/27 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=.1, .9, .025 +F=abs(x)+acos(x)+asin(x)+atan(x)+atan2(x,y)+ceil(x)+cos(x)+cosh(x)+cot(x)+csc(x) + pow(x,y) +C=fp_abs(x)+fp_acos(x)+fp_asin(x)+fp_atan(x)+fp_atan2(x,y)+fp_ceil(x)+fp_cos(x)+fp_cosh(x)+1.0/fp_tan(x)+1.0/fp_sin(x) +fp_pow(x,y) diff --git a/tests/99misc/28 b/tests/99misc/28 new file mode 100644 index 0000000..5492253 --- /dev/null +++ b/tests/99misc/28 @@ -0,0 +1,6 @@ +T=d f ld mf +V=x,y +R=.1, .9, .025 +F=exp(x)+floor(x)+int(x)+log(x)+log10(x)+max(x,y)+min(x,y)+sec(x)+sin(x)+sinh(x)+sqrt(x)+tan(x)+tanh(x)+ceil(y)+trunc(y) +C=fp_exp(x)+fp_floor(x)+fp_int(x)+fp_log(x)+fp_log10(x)+fp_max(x,y)+fp_min(x,y)+ \ + 1/fp_cos(x)+fp_sin(x)+fp_sinh(x)+fp_sqrt(x)+fp_tan(x)+fp_tanh(x)+fp_ceil(y)+fp_trunc(y) diff --git a/tests/99misc/29 b/tests/99misc/29 new file mode 100644 index 0000000..dc3cda6 --- /dev/null +++ b/tests/99misc/29 @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=x,y +R=-5,5,1 +F=x-y*1 +C=x-y*1 diff --git a/tests/99misc/3 b/tests/99misc/3 new file mode 100644 index 0000000..b34dee5 --- /dev/null +++ b/tests/99misc/3 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y,z +R=-7,7,.5 +F=(x=y & y=x)+ 1+2-3.1*4e2/.5 + x*x+y*y+z*z + (x&x) + (y|y) +C=fp_and(fp_equal(x,y), fp_equal(y,x))+ 1.0+2.0-3.1*4e2/.5 + x*x+y*y+z*z + fp_and(x,x) + fp_or(y,y) diff --git a/tests/99misc/30 b/tests/99misc/30 new file mode 100644 index 0000000..21f0c99 --- /dev/null +++ b/tests/99misc/30 @@ -0,0 +1,6 @@ +T=d f ld mf +V=x,y +R=3,10,1 +F=x - y*1 + (x%y) + x / (y^1.1) + 2^3 + 5%3 + x^(y^0) + x^0.5 +C=x - y*1 + fp_mod(x,y) + x / fp_pow(y,1.1) + fp_pow(2,3) + \ + fp_mod(5,3) + fp_pow(x,fp_pow(y,0)) + fp_pow(x,0.5) diff --git a/tests/99misc/31 b/tests/99misc/31 new file mode 100644 index 0000000..784e1c9 --- /dev/null +++ b/tests/99misc/31 @@ -0,0 +1,15 @@ +T=d ld mf +V=x,y,z +R=.1,4,.35 + +# This function is too complex for "float" accuracy + +F=x - (y*(y*(y*-1))*1) + log(x*exp(1.0)^y) - log(x^y) + \ + exp(1.0)^log(x+6) + 10^(log(x+6)/log(y+6)*log(z+6)/log(10)) - \ + exp(1.0)^(log(x+6)*y) - 5^(log(x+7)/log(5)) + (x*z+17)^3 * (x*z+17)^2 / \ + (x*z+17)^4 +C=x - (y*(y*(y*-1))*1) + fp_log(x*fp_pow(fp_exp(1.0),y)) - fp_log(fp_pow(x,y)) + \ + fp_pow(fp_exp(1.0),fp_log(x+6)) + \ + fp_pow(10.0,fp_log(x+6)/fp_log(y+6)*fp_log(z+6)/fp_log(10.0)) - \ + fp_pow(fp_exp(1.0), fp_log(x+6)*y) - fp_pow(5.0,fp_log(x+7)/fp_log(5.0)) + \ + fp_pow(x*z+17,3) * fp_pow(x*z+17,2) / fp_pow(x*z+17,4) diff --git a/tests/99misc/32 b/tests/99misc/32 new file mode 100644 index 0000000..d49dcaf --- /dev/null +++ b/tests/99misc/32 @@ -0,0 +1,43 @@ +T=d f ld mf +V=x,y,z +R=1,2,.05 +F=x\ + +y/y-min(3,4)-x-max(4,3)+max(3,4)-min(4,3)+0+(z*1)\ + +(x-2+2)+(x*0.5*2)+y*0\ + +min(min(min(4.0,x),1.0),min(x,min(min(y,4.0),z)))\ + +max(max(max(4.0,x),1.0),max(x,max(max(y,4.0),z)))\ + +(abs(1)+acos(1.0)+asin(1.0)+atan(1.0)+ceil(1.1)+cos(0.0)\ + +cosh(0.0)+floor(1.1)+log(1.0)+sin(0.0)+sinh(0.0)+tan(1.0)\ + +tanh(1.0)+atan2(1.0,1.0))\ + +(x-(y-z))\ + +(x+y) + (x*y)\ + +max(x,max(x,max(x,max(x,x))))*-1.0\ + +(z-z)\ + +1/sin(x/5) + 1/cos(y/5) + 1/tan(z/5)\ + +log10(cot(z/5) + csc(y/5) + sec(x/5))\ + +log(30+x)*log(40+y)/log(50+z)\ + +sin(x/57.295779513082320877)\ + +asin(x/10)*57.295779513082320877\ + +floor(-x) + 1/ceil(x)\ + +sqrt(5 * 0.2)\ + +(-x+-x+-x+-x+-x+-x) +C=x\ + +y/y-fp_min(3,4)-x-fp_max(4,3)+fp_max(3,4)-fp_min(4,3)+0+(z*1)\ + +(x-2+2)+(x*0.5*2)+y*0\ + +fp_min(fp_min(fp_min(4.0,x),1.0),fp_min(x,fp_min(fp_min(y,4.0),z)))\ + +fp_max(fp_max(fp_max(4.0,x),1.0),fp_max(x,fp_max(fp_max(y,4.0),z)))\ + +(fp_abs(1)+fp_acos(1.0)+fp_asin(1.0)+fp_atan(1.0)+fp_ceil(1.1)+fp_cos(0.0)\ + +fp_cosh(0.0)+fp_floor(1.1)+fp_log(1.0)+fp_sin(0.0)+fp_sinh(0.0)+fp_tan(1.0)\ + +fp_tanh(1.0)+fp_atan2(1.0,1.0))\ + +(x-(y-z))\ + +(x+y) + (x*y)\ + +fp_max(x,fp_max(x,fp_max(x,fp_max(x,x))))*-1.0\ + +(z-z)\ + +1/fp_sin(x/5) + 1/fp_cos(y/5) + 1/fp_tan(z/5)\ + +fp_log10(1/fp_tan(z/5) + 1/fp_sin(y/5) + 1/fp_cos(x/5))\ + +fp_log(30+x)*fp_log(40+y)/fp_log(50+z)\ + +fp_sin(x/57.295779513082320877)\ + +fp_asin(x/10)*57.295779513082320877\ + +fp_floor(-x) + 1/fp_ceil(x)\ + +fp_sqrt(5 * 0.2)\ + +(-x+-x+-x+-x+-x+-x) diff --git a/tests/99misc/33 b/tests/99misc/33 new file mode 100644 index 0000000..9e4ce2b --- /dev/null +++ b/tests/99misc/33 @@ -0,0 +1,8 @@ +T=d ld mf +V=x,y +R=-2,2,.1 + +# float accuracy just fails here. + +F=sin(sqrt(10-x*x+y*y))+cos(sqrt(15-x*x-y*y))+sin(x*x+y*y) +C=fp_sin(fp_sqrt(10-x*x+y*y))+fp_cos(fp_sqrt(15-x*x-y*y))+fp_sin(x*x+y*y) diff --git a/tests/99misc/34 b/tests/99misc/34 new file mode 100644 index 0000000..cad1a74 --- /dev/null +++ b/tests/99misc/34 @@ -0,0 +1,5 @@ +T=d f ld mf li gi +V=t,う,お,早 +R=-5,5,1 +F=お+早*う-t +C=お+早*う-t diff --git a/tests/99misc/35 b/tests/99misc/35 new file mode 100644 index 0000000..487691e --- /dev/null +++ b/tests/99misc/35 @@ -0,0 +1,7 @@ +T=d f ld mf li gi +V=A_very_long_variable_name_1,A_very_long_variable_name_2,Yet_a_third_very_long_variable_name +R=-10,10,1 +F=A_very_long_variable_name_1-A_very_long_variable_name_2+ \ + Yet_a_third_very_long_variable_name*A_very_long_variable_name_1 +C=A_very_long_variable_name_1-A_very_long_variable_name_2+ \ + Yet_a_third_very_long_variable_name*A_very_long_variable_name_1 diff --git a/tests/99misc/37 b/tests/99misc/37 new file mode 100644 index 0000000..4bf1ae6 --- /dev/null +++ b/tests/99misc/37 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-10,10,.1 +F=5 + 7.5*8 / 3 - 2^4*2 + 7%2+4 + x +C=5 + 7.5*8 / 3 - fp_pow(2,4)*2 + fp_mod(7,2)+4 + x diff --git a/tests/99misc/38 b/tests/99misc/38 new file mode 100644 index 0000000..c6a0b5f --- /dev/null +++ b/tests/99misc/38 @@ -0,0 +1,5 @@ +T=d ld mf +V=x,y,z +R=-.9, .9, .1 +F=asinh(x) + 1.5*acosh(y+3) + 2.5*atanh(z) +C=fp_asinh(x) + 1.5*fp_acosh(y+3) + 2.5*fp_atanh(z) diff --git a/tests/99misc/39 b/tests/99misc/39 new file mode 100644 index 0000000..44f8894 --- /dev/null +++ b/tests/99misc/39 @@ -0,0 +1,12 @@ +T=d ld mf +V=x,y,z +R=-1.3, 1.3, .15 + +# This function is too hard for 'float' accuracy + +F=sin(x+cos(y*1.5))-cos(x+sin(y*1.5))+z*z*z*sin(z*z*z-x*x-y*y)- \ + cos(y*1.5)*sin(x+cos(y*1.5))+x*y*z+x*y*2.5+x*y*z*cos(x)+x*y*cos(x)+x*z*cos(x)+ \ + y*z*2.5+(x*y*z*cos(x)-x*y*z-y*cos(x)-x*z*y+x*y+x*z-cos(x)*x) +C=fp_sin(x+fp_cos(y*1.5))-fp_cos(x+fp_sin(y*1.5))+z*z*z*fp_sin(z*z*z-x*x-y*y)- \ + fp_cos(y*1.5)*fp_sin(x+fp_cos(y*1.5))+x*y*z+x*y*2.5+x*y*z*fp_cos(x)+x*y*fp_cos(x)+x*z*fp_cos(x)+ \ + y*z*2.5+(x*y*z*fp_cos(x)-x*y*z-y*fp_cos(x)-x*z*y+x*y+x*z-fp_cos(x)*x) diff --git a/tests/99misc/4 b/tests/99misc/4 new file mode 100644 index 0000000..5a87782 --- /dev/null +++ b/tests/99misc/4 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-10,10,.5 +F= ( ((( ( x-y) -( ((y) *2) -3)) )* 4))+sin(x)*cos(y)-cos(x)*sin(y) +C=( ((( ( x-y) -( ((y) *2) -3)) )* 4))+fp_sin(x)*fp_cos(y)-fp_cos(x)*fp_sin(y) diff --git a/tests/99misc/40 b/tests/99misc/40 new file mode 100644 index 0000000..3dcb6ea --- /dev/null +++ b/tests/99misc/40 @@ -0,0 +1,16 @@ +T=d ld mf +V=x,y,z +R=-1.3,1.3,.075 + +# This function is too hard for 'float' accuracy + +F=(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)* \ + (x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)+ \ + 2*(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)- \ + x*y*(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)+ \ + x*(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z) +C=(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)* \ + (x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)+ \ + 2*(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)- \ + x*y*(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z)+ \ + x*(x+x+x+x+x+x+x+x+x+x+x+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z+y+z) diff --git a/tests/99misc/41 b/tests/99misc/41 new file mode 100644 index 0000000..16e06c8 --- /dev/null +++ b/tests/99misc/41 @@ -0,0 +1,16 @@ +T=d ld mf +V=x,y,z +R=-2, 2, .15 + +# This function is too complex for "float" accuracy + +F=x*3+x*y+x*z+x*sin(y*z) - \ + (sin(x)+cos(y))*4 + \ + (sin(x)+cos(y))*x + \ + (sin(x)+cos(y))*y + \ + (sin(x)+cos(y))*z +C=x*3+x*y+x*z+x*fp_sin(y*z) - \ + (fp_sin(x)+fp_cos(y))*4 + \ + (fp_sin(x)+fp_cos(y))*x + \ + (fp_sin(x)+fp_cos(y))*y + \ + (fp_sin(x)+fp_cos(y))*z diff --git a/tests/99misc/43 b/tests/99misc/43 new file mode 100644 index 0000000..321c2c2 --- /dev/null +++ b/tests/99misc/43 @@ -0,0 +1,8 @@ +T=d ld mf +V=x +R=-100,100,.03 + +# This function is too complex for "float" accuracy + +F=log(x*x)+abs(exp(abs(x)+1)) +C=fp_log(x*x)+fp_abs(fp_exp(fp_abs(x)+1)) diff --git a/tests/99misc/44 b/tests/99misc/44 new file mode 100644 index 0000000..74c774b --- /dev/null +++ b/tests/99misc/44 @@ -0,0 +1,21 @@ +T=d f ld mf +V=x +R=0,100,.125 +F=(x^2)^(1/8) + \ + 1.1*(x^3)^(1/7) + \ + 1.2*(x^4)^(1/6) + \ + 1.3*(x^5)^(1/5) + \ + 1.4*(x^6)^(1/6) + \ + 1.5*(x^7)^(1/4) + \ + 1.6*(x^8)^(1/3) + \ + 1.7*(x^9)^(1/2) + \ + 1.8*(sqrt(abs(-sqrt(x))^3)) +C=fp_pow(x*x, 1/8) + \ + 1.1*fp_pow(x*x*x, 1/7) + \ + 1.2*fp_pow(x*x*x*x, 1/6) + \ + 1.3*fp_pow(x*x*x*x*x, 1/5) + \ + 1.4*fp_pow(x*x*x*x*x*x, 1/6) + \ + 1.5*fp_pow(x*x*x*x*x*x*x, 1/4) + \ + 1.6*fp_pow(x*x*x*x*x*x*x*x, 1/3) + \ + 1.7*fp_pow(x*x*x*x*x*x*x*x*x, 1/2) + \ + 1.8*(fp_sqrt(fp_pow(fp_abs(-fp_sqrt(x)), 3))) diff --git a/tests/99misc/45 b/tests/99misc/45 new file mode 100644 index 0000000..8e15094 --- /dev/null +++ b/tests/99misc/45 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-10,10,.025 +F=(x^2)^(1/7) + 1.1*(x^4)^(1/5) + 1.2*(x^6)^(1/3) +C=fp_pow(x*x, 1/7) + 1.1*fp_pow(x*x*x*x, 1/5) + 1.2*fp_pow(x*x*x*x*x*x, 1/3) diff --git a/tests/99misc/46 b/tests/99misc/46 new file mode 100644 index 0000000..467e50a --- /dev/null +++ b/tests/99misc/46 @@ -0,0 +1,10 @@ +T=d f ld mf +V=x,y +R=-.9, .9, .15 +F=abs(floor(acos(x)+4)) + 1.1*abs(floor(acos(y)+1.5)) + \ + (acos(x) < (acos(y)-10)) + 1.2*max(-4, acos(x)) + 1.3*min(9, acos(x)-9) +C=fp_abs(fp_floor(fp_acos(x)+4)) + \ + 1.1*fp_abs(fp_floor(fp_acos(y)+1.5)) + \ + fp_less(fp_acos(x), (fp_acos(y)-10)) + \ + 1.2*fp_max(-4, fp_acos(x)) + \ + 1.3*fp_min(9, fp_acos(x)-9) diff --git a/tests/99misc/47 b/tests/99misc/47 new file mode 100644 index 0000000..7d7124a --- /dev/null +++ b/tests/99misc/47 @@ -0,0 +1,7 @@ +T=d f ld mf +V=x,y +R=-3, 3, .1 +F=1.25*(exp(x)+exp(-x)) + 1.5*(exp(y)-exp(-y)) + \ + 1.75*((exp(-x)+exp(x))/2) + 2.0*((exp(-x)-exp(x))/2) + 2.25*(cosh(y)+sinh(y)) +C=1.25*(fp_exp(x)+fp_exp(-x)) + 1.5*(fp_exp(y)-fp_exp(-y)) + \ + 1.75*((fp_exp(-x)+fp_exp(x))/2) + 2.0*((fp_exp(-x)-fp_exp(x))/2) + 2.25*(fp_cosh(y)+fp_sinh(y)) diff --git a/tests/99misc/48 b/tests/99misc/48 new file mode 100644 index 0000000..a283522 --- /dev/null +++ b/tests/99misc/48 @@ -0,0 +1,6 @@ +T=d f ld mf +V=x +R=2, 1e9, 1.2e7 +F=sinh((log(x)/5+1)*5) + 1.2*cosh((log(x)/log(2)+1)*log(2)) + !(x | !(x/4)) +C=fp_sinh((fp_log(x)/5+1)*5) + 1.2*fp_cosh((fp_log(x)/fp_log(2)+1)*fp_log(2)) + \ + fp_not(fp_or(fp_truth(x), fp_not(x/4))) diff --git a/tests/99misc/49 b/tests/99misc/49 new file mode 100644 index 0000000..a2dfcb1 --- /dev/null +++ b/tests/99misc/49 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-100, 100, .05 +F=atan2(0, x) + (-4*(x-100))^3.3 +C=fp_atan2(0, x) + fp_pow(-4*(x-100), 3.3) diff --git a/tests/99misc/5 b/tests/99misc/5 new file mode 100644 index 0000000..30deb42 --- /dev/null +++ b/tests/99misc/5 @@ -0,0 +1,5 @@ +T=d f ld mf +V=__A5_x08,o__5_0AB_ +R=.1,8,.15 +F=__A5_x08^o__5_0AB_ +C=fp_pow(__A5_x08, o__5_0AB_) diff --git a/tests/99misc/50 b/tests/99misc/50 new file mode 100644 index 0000000..ebe6d9c --- /dev/null +++ b/tests/99misc/50 @@ -0,0 +1,23 @@ +T=d f ld mf li gi +V=x,y +R=-10, 10, 1 +F=(x<y | y<x) + \ + 2*(x<y & y<x) + \ + 4*(x<=y & y<=x) + \ + 8*(x<y & x!=y) + \ + 16*(x<y | x!=y) + \ + 32*(x<=y & x>=y) + \ + 64*(x<=y | x>=y) + \ + 128*(x!=y & x=y) + \ + 256*(x!=y & x!=y) + \ + 512*(x<=y & x=y) +C=fp_or(fp_less(x,y), fp_less(y,x)) + \ + 2*fp_and(fp_less(x,y), fp_less(y,x)) + \ + 4*fp_and(fp_lessOrEq(x,y), fp_lessOrEq(y,x)) + \ + 8*fp_and(fp_less(x,y), fp_nequal(x,y)) + \ + 16*fp_or(fp_less(x,y), fp_nequal(x,y)) + \ + 32*fp_and(fp_lessOrEq(x,y), fp_greaterOrEq(x,y)) + \ + 64*fp_or(fp_lessOrEq(x,y), fp_greaterOrEq(x,y)) + \ + 128*fp_and(fp_nequal(x,y), fp_equal(x,y)) + \ + 256*fp_and(fp_nequal(x,y), fp_nequal(x,y)) + \ + 512*fp_and(fp_lessOrEq(x,y), fp_equal(x,y)) diff --git a/tests/99misc/52 b/tests/99misc/52 new file mode 100644 index 0000000..16cc375 --- /dev/null +++ b/tests/99misc/52 @@ -0,0 +1,9 @@ +T=d f ld mf +V=x +R=-10, 10, .5 +F=x + (1.0+2.0+3.0+4.0-5.0-6.0-7.0-8.0)/3.0 + \ + 4.0*(1.0+sin(2.0)+cos(4.0*5.0+6.0)/2.0) + cos(0.5)*tan(0.6+0.2) - \ + 1.1/log(2.1)*sqrt(3.3) + 2^3 +C=x + (1.0+2.0+3.0+4.0-5.0-6.0-7.0-8.0)/3.0 + \ + 4.0*(1.0+fp_sin(2.0)+fp_cos(4.0*5.0+6.0)/2.0) + fp_cos(0.5)*fp_tan(0.6+0.2) - \ + 1.1/fp_log(2.1)*fp_sqrt(3.3) + fp_pow(2,3) diff --git a/tests/99misc/53 b/tests/99misc/53 new file mode 100644 index 0000000..b7d7a6f --- /dev/null +++ b/tests/99misc/53 @@ -0,0 +1,8 @@ +T=d f ld mf +V=x,y +R=0, 10, 0.5 +F=(x&y) + 4*(int(x/10)|int(y/10)) + 8*((-!-!-x)+(!-!-!y)) + 16*(-------x + !!!!!!!y) +C=fp_and(x,y) + 4*fp_or(fp_int(x/10), fp_int(y/10)) + \ + 8*((-fp_not(-fp_not(-x)))+ \ + (fp_not(-fp_not(-fp_not(y))))) \ + + 16*(-x + fp_not(y)) diff --git a/tests/99misc/54 b/tests/99misc/54 new file mode 100644 index 0000000..588856e --- /dev/null +++ b/tests/99misc/54 @@ -0,0 +1,20 @@ +T=d f ld mf +V=x,y +R=-10, 100, .5 +F=(x<y)+(x<=y)+(x>y)+(x>=y)+ \ + (x=y)+(x!=y)+(x&y)+(x|y)+ \ + (!x)+(!!x)+ \ + !((x<y)&(x<3))+ \ + !!(!(x>y)|(x>3)) +C=fp_less(x,y)+\ + fp_lessOrEq(x,y)+\ + fp_greater(x,y)+\ + fp_greaterOrEq(x,y)+ \ + fp_equal(x,y)+\ + fp_nequal(x,y)+\ + fp_and(x,y)+\ + fp_or(x,y)+ \ + fp_not(x)+\ + fp_truth(x)+ \ + fp_not(fp_and(fp_less(x,y),fp_less(x,3)))+ \ + fp_or( fp_not(fp_greater(x,y)), fp_greater(x,3)) diff --git a/tests/99misc/55 b/tests/99misc/55 new file mode 100644 index 0000000..21f04f5 --- /dev/null +++ b/tests/99misc/55 @@ -0,0 +1,9 @@ +T=d f ld mf +V=x,y +R=1,100, .5 +F=(x^1.2 < 0) + (y^2.5 < 0) + 2*(x*x<0) + 3*(y^3<0) + 4*(x^4<0) +C=fp_less(fp_pow(x,1.2), 0) + \ + fp_less(fp_pow(y,2.5), 0) + \ + 2*fp_less(x*x, 0) + \ + 3*fp_less(fp_pow(y,3), 0) + \ + 4*fp_less(fp_pow(x,4), 0) diff --git a/tests/99misc/56 b/tests/99misc/56 new file mode 100644 index 0000000..e953ab6 --- /dev/null +++ b/tests/99misc/56 @@ -0,0 +1,10 @@ +T=d f ld mf +V=x +R=.25, 100, .25 + +# 1.75e21 is an arbitrary value larger than 2^64, which +# is the limit where repeated runs of the fprem opcode +# on 387 is required. + +F=1.75e21%x +C=fp_mod(1.75e21, x) diff --git a/tests/99misc/58 b/tests/99misc/58 new file mode 100644 index 0000000..e8f8b64 --- /dev/null +++ b/tests/99misc/58 @@ -0,0 +1,15 @@ +# Also test number i4 + +T=d f ld mf li gi +V=x,y +R=-11, 11, 1 +F=(-x < 3) + (x*-1 > 5) + (x*-3 < 10) + (x*-3 < y*7) + \ + (x*4 < y*7) + (x*6 < y*-3) + (-x < 11) + (5 < -y) +C=fp_less(-x, 3) + \ + fp_greater(x*-1, 5) + \ + fp_less(x*-3, 10) + \ + fp_less(x*-3, y*7) + \ + fp_less(x*4, y*7) + \ + fp_less(x*6, y*-3) + \ + fp_less(-x, 11) + \ + fp_less(5, -y) diff --git a/tests/99misc/59 b/tests/99misc/59 new file mode 100644 index 0000000..f1009f5 --- /dev/null +++ b/tests/99misc/59 @@ -0,0 +1,11 @@ +T=d f ld mf +V=x +R=-3, 3, 0.2 +F=(cos(x) < sin(x)) + \ + (cos(x)-sin(x)) + \ + sub(sinh(x)-cosh(x), sinh(x)/cosh(x)) + \ + sqrt(cos(x)^2+sin(x)^2) +C=fp_less(fp_cos(x), fp_sin(x)) + \ + (fp_cos(x) - fp_sin(x)) + \ + ((fp_sinh(x)-fp_cosh(x)) - (fp_sinh(x)/fp_cosh(x))) + \ + Value_t(1) diff --git a/tests/99misc/7 b/tests/99misc/7 new file mode 100644 index 0000000..4a94ab0 --- /dev/null +++ b/tests/99misc/7 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x +R=-10,10,.01 +F=cos(x)*sin(1-x)*(1-cos(x/2)*sin(x*5)) +C=fp_cos(x)*fp_sin(1-x)*(1-fp_cos(x/2)*fp_sin(x*5)) diff --git a/tests/99misc/8 b/tests/99misc/8 new file mode 100644 index 0000000..cce4111 --- /dev/null +++ b/tests/99misc/8 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y +R=-8,8,.2 +F=atan2(x,y)+max(x,y) +C=fp_atan2(x,y) + (x>y ? x : y) diff --git a/tests/99misc/9 b/tests/99misc/9 new file mode 100644 index 0000000..221b9b5 --- /dev/null +++ b/tests/99misc/9 @@ -0,0 +1,5 @@ +T=d f ld mf +V=x,y,z +R=1,15,.7 +F=1.5+x*y-2+4/8+z+z+z+z+x/(y*z) +C=1.5+x*y-2.0+4.0/8.0+z+z+z+z+x/(y*z) diff --git a/tests/99misc/i1 b/tests/99misc/i1 new file mode 100644 index 0000000..68113db --- /dev/null +++ b/tests/99misc/i1 @@ -0,0 +1,5 @@ +T=li gi +V=x,y,z +R=-8,7,1 +F=1+2+3-4*5*6/3+10/2-9%2 + (x+y - 11*x + z/10 + x/(z+31)) +C=1+2+3-4*5*6/3+10/2-9%2 + (x+y - 11*x + z/10 + x/(z+31)) diff --git a/tests/99misc/i2 b/tests/99misc/i2 new file mode 100644 index 0000000..faa97a7 --- /dev/null +++ b/tests/99misc/i2 @@ -0,0 +1,7 @@ +T=li gi +V=x,y,z +R=-7,7,1 +F=if(abs(x*y) < 20 | x+y > 30 & z > 5, min(x,2*y), max(y,z*2)) +C=((fp_abs(x*y) < 20) \ + || (((x+y) > 30) \ + && (z > 5))) ? fp_min(x,2*y) : fp_max(y,z*2) diff --git a/tests/99misc/i3 b/tests/99misc/i3 new file mode 100644 index 0000000..4893187 --- /dev/null +++ b/tests/99misc/i3 @@ -0,0 +1,9 @@ +T=li gi +V=x,y,z +R=1,7,1 +F=(x+y) + 2*(x-z) + 3*(x*y) + 4*(y/z) + 5*(x%z) + \ + 6*(x<y) + 7*(x<=z) + 8*(x>2*z) + 9*(y>=3*z) + 10*(x+y!=z) + \ + 11*(100+x) + 12*(101-y) + 13*(102*z) + 14*(103/x) +C=(x+y) + 2*(x-z) + 3*(x*y) + 4*(y/z) + 5*fp_mod(x,z) + \ + 6*(x<y) + 7*(x<=z) + 8*(x>2*z) + 9*(y>=3*z) + 10*(x+y!=z) + \ + 11*(100+x) + 12*(101-y) + 13*(102*z) + 14*(103/x) diff --git a/tests/make_tests.cc b/tests/make_tests.cc new file mode 100644 index 0000000..2ed6c79 --- /dev/null +++ b/tests/make_tests.cc @@ -0,0 +1,1099 @@ +#include <vector> +#include <map> +#include <set> +#include <string> +#include <sstream> +#include <cstdio> +#include <cctype> +#include <iostream> +#include <fstream> +#include <cstring> +#include <cstdlib> +#include <algorithm> + +namespace +{ + std::string GetDefinesFor(const std::string& type) + { + if(type == "float") return "FP_TEST_WANT_FLOAT_TYPE"; + if(type == "long double") return "FP_TEST_WANT_LONG_DOUBLE_TYPE"; + if(type == "long") return "FP_TEST_WANT_LONG_INT_TYPE"; + if(type == "double") return "FP_TEST_WANT_DOUBLE_TYPE"; + if(type == "MpfrFloat") return "FP_TEST_WANT_MPFR_FLOAT_TYPE"; + if(type == "GmpInt") return "FP_TEST_WANT_GMP_INT_TYPE"; + if(type == "std::complex<double>") return "FP_TEST_WANT_COMPLEX_DOUBLE_TYPE"; + if(type == "std::complex<float>") return "FP_TEST_WANT_COMPLEX_FLOAT_TYPE"; + if(type == "std::complex<long double>") return "FP_TEST_WANT_COMPLEX_LONG_DOUBLE_TYPE"; + return std::string(); + } + std::string GetTypeForDefine(const std::string& def) + { + if(def == "FP_TEST_WANT_FLOAT_TYPE") return "float"; + if(def == "FP_TEST_WANT_LONG_DOUBLE_TYPE") return "long double"; + if(def == "FP_TEST_WANT_LONG_INT_TYPE") return "long"; + if(def == "FP_TEST_WANT_DOUBLE_TYPE") return "double"; + if(def == "FP_TEST_WANT_MPFR_FLOAT_TYPE") return "MpfrFloat"; + if(def == "FP_TEST_WANT_GMP_INT_TYPE") return "GmpInt"; + if(def == "FP_TEST_WANT_COMPLEX_DOUBLE_TYPE") return "std::complex<double>"; + if(def == "FP_TEST_WANT_COMPLEX_FLOAT_TYPE") return "std::complex<float>"; + if(def == "FP_TEST_WANT_COMPLEX_LONG_DOUBLE_TYPE") return "std::complex<long double>"; + return "double"; + } + std::string NumConst(const std::string& type, const std::string& value, bool direct_cast = false) + { + if(direct_cast) + { + if(type == "long") return value + "l"; + + std::string fltvalue = value; + + char* endptr = 0; + strtol(value.c_str(), &endptr, 10); + if(endptr && !*endptr) + fltvalue += ".0"; + + if(type == "float" + || type == "std::complex<float>") return fltvalue + "f"; + if(type == "long double" + || type == "std::complex<long double>") return fltvalue + "l"; + if(type == "double") return fltvalue; + return value; + } + else + { + size_t n_trailing_zeros = 0; + while(n_trailing_zeros < value.size() + && value[value.size()-1-n_trailing_zeros] == '0') + ++n_trailing_zeros; + if(n_trailing_zeros < value.size() + && value[value.size()-1-n_trailing_zeros] == '.') + { + return NumConst(type, value.substr(0, value.size()-1-n_trailing_zeros)); + } + + if(type == "std::complex<double>" + || type == "std::complex<float>" + || type == "std::complex<long double>") + { + /* N() and P() require two parameters: a real part and an imaginary part. + * Make those two parts. + */ + const char* first_part = value.c_str(); + const char* second_part_begin = first_part; + + if(*first_part == '+' || *first_part == '-') + ++second_part_begin; + while(*second_part_begin != '\0' + && !( (*second_part_begin == '-' + || *second_part_begin == '+') + && second_part_begin[-1] != 'e' + && second_part_begin[-1] != 'E')) ++second_part_begin; + std::string first_part_str(first_part, second_part_begin - first_part); + std::string second_part_str(second_part_begin); + if(second_part_str.empty()) + { + second_part_str = "0"; + if(value[value.size()-1] == 'i' + || value[value.size()-1] == 'I') + first_part_str.erase(first_part_str.size()-1); + } + else + { + if(value[value.size()-1] == 'i' + || value[value.size()-1] == 'I') + { + second_part_str.erase(second_part_str.size()-1); + } + } + if(first_part_str.find('.') == std::string::npos + && first_part_str.find('e') == std::string::npos + ) first_part_str += ".0"; + if(second_part_str.find('.') == std::string::npos + && second_part_str.find('e') == std::string::npos + ) second_part_str += ".0"; + return "N(" + first_part_str + "," + second_part_str + ")"; + } + char* endptr = 0; + long longval = strtol(value.c_str(), &endptr, 10); + if(endptr && !*endptr) + { + if(longval == (long)(float)(longval)) return value; + //if(longval >= -32768 && longval < 32767) return value; + return "P(" + value + ")"; + } + return "N(" + value + ")"; + } + } + std::string NumConstDefines(const std::string& type) + { + if(type == "std::complex<double>") + return "#define N(x,y) (Value_t(x,y))\n"; + if(type == "std::complex<float>") + return "#define N(x,y) (Value_t(APP(x,f),APP(y,f)))\n"; + if(type == "std::complex<long double>") + return "#define N(x,y) (Value_t(APP(x,l),APP(y,l)))\n"; + if(type == "MpfrFloat") + return "#define N(x) (Value_t(#x,0))\n" + "#define P(x) N(x)\n"; + if(type == "long" || type == "GmpInt") + return "#define P(x) (APP(x,l))\n"; + std::string result = "(x)"; + if(type == "float") result = "(APP(x,f))"; + if(type == "long double") result = "(APP(x,l))"; + return "#define N(x) " + result + "\n" + "#define P(x) N(x##.0)\n"; + } + std::string NumConstUndefines(const std::string& type) + { + if(type == "std::complex<double>" + || type == "std::complex<float>" + || type == "std::complex<long double>") return "#undef N\n"; + if(type == "long" || type == "GmpInt") return "#undef P\n"; + return "#undef N\n" + "#undef P\n"; + } + std::string GetTypeFor(const std::string& typecode) + { + if(typecode == "d") + return ("double"); + else if(typecode == "f") + return ("float"); + else if(typecode == "ld") + return ("long double"); + else if(typecode == "li") + return ("long"); + else if(typecode == "mf") + return ("MpfrFloat"); + else if(typecode == "gi") + return ("GmpInt"); + else if(typecode == "cd") + return ("std::complex<double>"); + else if(typecode == "cf") + return ("std::complex<float>"); + else if(typecode == "cld") + return ("std::complex<long double>"); + return typecode; + } + std::string test_declaration(const std::string& name) + { + return "template<typename Value_t> static Value_t "+name+"(const Value_t* vars)"; + } + /*std::string test_specialization(const std::string& name, const std::string& type) + { + return "template<> Value_t "+name+"<Value_t> (const Value_t* vars) /""* " + type + " *""/"; + }*/ + std::string test_specialized_declaration(const std::string& name, const std::string& type) + { + return "Value_t "+name+"(const Value_t* vars) /""* " + type + " *""/"; + } +} + + +struct TestData +{ + std::string IfDef; + + std::string FuncString, ParamString; + unsigned ParamAmount; + std::string ParamValueRanges; + bool UseDegrees; + std::string TestFuncName, TestName; + std::set<std::string> DataTypes; + + TestData(): + FuncString(), ParamString(), + ParamAmount(0), + ParamValueRanges(), + UseDegrees(false), + TestFuncName(), TestName() + { + } +}; + +typedef std::vector<TestData> TestCollection; + +std::map<std::string/*datatype*/, + TestCollection> tests; + +std::set<std::string> mpfrconst_set; + +struct section_data +{ + std::string test_list; + std::string definitions; + std::map<std::string, std::string> namespace_functions; +}; +std::map<std::string, section_data> define_sections; + +std::string default_function_section; +std::map<std::string, std::pair<std::string, std::string> > class_declarations; + +std::string TranslateString(const std::string& str); + +static const char cbuf[] = +"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"; + +template<typename CharT> +void +str_replace_inplace(std::basic_string<CharT>& where, + const std::basic_string<CharT>& search, + const std::basic_string<CharT>& with) +{ + for(typename std::basic_string<CharT>::size_type a = where.size(); + (a = where.rfind(search, a)) != where.npos; + ) + { + where.replace(a, search.size(), with); + if(a--==0) break; + } +} + + +void ListTests(std::ostream& outStream) +{ + unsigned DefineCounter=0; + std::map<std::string, std::string> TestDefines; + + for(std::map<std::string, TestCollection>::const_iterator + i = tests.begin(); + i != tests.end(); + ++i) + { + std::ostringstream listbuffer; + + const std::string& type = i->first; + std::string defines = GetDefinesFor(type); + size_t n_tests = i->second.size(); + + listbuffer << "\n"; + + //listbuffer << "#define Value_t " << type << "\n"; + listbuffer << + "template<>\n" + "const TestType<Value_t>\n" + " RegressionTests<Value_t>::Tests[]"; + if(n_tests == 0) + { + listbuffer << + " = { TestType<Value_t>() };\n"; + } + else + { + listbuffer << " =\n{\n"; + for(size_t a=0; a<n_tests; ++a) + { + const TestData& testdata = i->second[a]; + + std::ostringstream linebuf; + + std::ostringstream ranges; + const char* rangesdata = testdata.ParamValueRanges.c_str(); + while(*rangesdata) + { + char* endptr = 0; + std::strtod(rangesdata, &endptr); + if(endptr && endptr != rangesdata) + { + /* Complex number support: */ + if(*endptr == 'i' || *endptr == 'I') + ++endptr; + else if(*endptr == '+' || *endptr == '-') + { + std::strtod(endptr, &endptr); + if(*endptr == 'i' || *endptr == 'I') ++endptr; + } + ranges << NumConst(type, std::string(rangesdata,endptr-rangesdata)); + rangesdata = endptr; + } + else + ranges << *rangesdata++; + } + + int n_duplicates = (int)testdata.DataTypes.size(); + + linebuf + << " { " << testdata.ParamAmount + << ", " << ranges.str() + << ", " << (testdata.UseDegrees ? "true" : "false") + << ", " << testdata.TestFuncName + << ","; + + if(/*type == "MpfrFloat" + &&*/ testdata.DataTypes.find("double") + != testdata.DataTypes.end()) + { + // If the same test is defined for both "double" and + // "MpfrFloat", include an extra pointer to the "double" + // test in the "MpfrFloat" test. + linebuf << "DBL_ONLY(" << testdata.TestFuncName << ")"; + //n_duplicates = 1; + } + else + linebuf << "DBL_ONLY(0)"; + + if(/*type == "GmpInt" + &&*/ testdata.DataTypes.find("long") + != testdata.DataTypes.end()) + { + // If the same test is defined for both "long" and + // "GmpInt", include an extra pointer to the "long" + // test in the "GmpInt" test. + linebuf << "LNG_ONLY(" << testdata.TestFuncName << ")"; + //n_duplicates = 1; + } + else + linebuf << "LNG_ONLY(0)"; + + linebuf + << "\n " << TranslateString(testdata.ParamString) + << ", " << TranslateString(testdata.TestName) + << ", " << TranslateString(testdata.FuncString) + << " },\n"; + + /*if(testdata.DataTypes.find("double") + != testdata.DataTypes.end() + && testdata.DataTypes.find("MpfrFloat") + != testdata.DataTypes.end()) + { + --n_duplicates; + } + if(testdata.DataTypes.find("long") + != testdata.DataTypes.end() + && testdata.DataTypes.find("GmpInt") + != testdata.DataTypes.end()) + { + --n_duplicates; + }*/ + + if(!testdata.IfDef.empty()) + listbuffer << "#if " << testdata.IfDef << "\n"; + + if(n_duplicates > 1) + { + std::string teststr(linebuf.str()); + std::map<std::string, std::string>::iterator + i = TestDefines.lower_bound(teststr); + if(i == TestDefines.end() || i->first != teststr) + { + char MacroName[32], *m = MacroName; + unsigned p = DefineCounter++; + *m++ = "STUWY"[p%5]; p/=5; + for(; p != 0; p /= 63) + *m++ = cbuf[p % 63]; + *m++ = '\0'; + TestDefines.insert(i, std::pair<std::string,std::string> + (teststr, MacroName)); + + str_replace_inplace(teststr, + std::string("\n"), std::string(" ")); + /*while(!teststr.empty() && (teststr[teststr.size()-1]==' ' + || teststr[teststr.size()-1]==',')) + teststr.erase(teststr.size()-1); + */ + outStream << "#define " << MacroName << " " << teststr << "\n"; + listbuffer << MacroName << "\n"; + } + else + listbuffer << i->second << "\n"; + } + else + { + listbuffer << linebuf.str(); + } + + if(!testdata.IfDef.empty()) + listbuffer << "#endif /*" << testdata.IfDef << " */\n"; + } + listbuffer << " TestType<Value_t>()\n};\n"; + } + + //listbuffer << "#undef Value_t\n"; + define_sections[defines].test_list += listbuffer.str(); + } +} + +void CompileFunction(const char*& funcstr, const std::string& eval_name, + std::ostream& declbuf, + std::ostream& codebuf, + const std::string& limited_to_datatype) +{ + static unsigned BufCounter = 0; + + unsigned depth = 0; + + while(*funcstr && *funcstr != '}' && (*funcstr != ',' || depth>0)) + { + if(strncmp(funcstr, "EVAL", 4) == 0) + { + codebuf << eval_name; + funcstr += 4; + continue; + } + if(funcstr[0] == '(' && funcstr[1] == '{') + { + codebuf << "<Value_t>("; + funcstr += 2; + unsigned NParams = 0; + std::string BufName; + + codebuf << "("; + for(;;) + { + while(std::isspace(*funcstr)) ++funcstr; + if(!*funcstr) break; + if(*funcstr == '}') { ++funcstr; break; } + + ++NParams; + if(NParams == 1) + { + std::ostringstream BufNameBuf; + BufNameBuf << "b" << BufCounter++; + BufName = BufNameBuf.str(); + } + + codebuf << BufName << "[" << (NParams-1) << "]=("; + + CompileFunction(funcstr, eval_name, + declbuf, codebuf, limited_to_datatype); + + codebuf << "), "; + if(*funcstr == ',') ++funcstr; + } + + if(NParams) + { + declbuf << " Value_t " << BufName << "[" << NParams << "];\n"; + codebuf << BufName; + } + else + { + codebuf << "0"; + } + codebuf << "))"; + while(std::isspace(*funcstr)) ++funcstr; + if(*funcstr == ')') ++funcstr; + } + else + { + if(*funcstr == '(') ++depth; + if(*funcstr == ')') --depth; + + char* endptr = 0; + if((*funcstr >= '0' && *funcstr <= '9') + || *funcstr == '.' + || (*funcstr == '-' && funcstr[-1] == '(') + ) + std::strtod(funcstr, &endptr); + if(endptr && endptr != funcstr) + { + if(limited_to_datatype == "MpfrFloat") + { + std::string num(funcstr, endptr-funcstr); + char* endptr2 = 0; + strtol(funcstr, &endptr2, 0); + //fprintf(stderr, "<%s>:<%s>\n", funcstr, endptr2); + if(endptr2==endptr-2 && std::strncmp(endptr2, ".0", 2) == 0) + { + num.erase(num.size()-2, 2); // made-int + codebuf << "Value_t(" << num << ")"; + } + else if(endptr2 && endptr2 == endptr) // an int or long + { + codebuf << "Value_t(" << num << ")"; + } + else + { + std::string mpfrconst_name = "mflit" + num; + str_replace_inplace(mpfrconst_name, std::string("."), std::string("_")); + str_replace_inplace(mpfrconst_name, std::string("+"), std::string("p")); + str_replace_inplace(mpfrconst_name, std::string("-"), std::string("m")); + + if(mpfrconst_set.insert(mpfrconst_name).second) + { + std::string& defs = define_sections["FP_TEST_WANT_MPFR_FLOAT_TYPE"].definitions; + if(defs.empty()) + defs += "static const Value_t "; + else + { + defs.erase(defs.size()-2, 2); /* Remove ";\n" */ + defs += ",\n "; + } + defs += mpfrconst_name + "(\"" + num + "\", 0);\n"; + } + codebuf << mpfrconst_name; + } + //if(*endptr == 'f' || *endptr == 'l') ++endptr; + } + else + { + std::string num(funcstr, endptr-funcstr); + if(limited_to_datatype.empty()) + codebuf << "Value_t(" << num << "l)"; + else + codebuf << NumConst(limited_to_datatype, num, true); + /* + if(*endptr == 'f' || *endptr == 'l') + num += *endptr++; + else + num += 'l'; + codebuf << "Value_t(" << num << ")"; + */ + } + funcstr = endptr; + } + else if((*funcstr >= 'A' && *funcstr <= 'Z') + || (*funcstr >= 'a' && *funcstr <= 'z') + || *funcstr == '_') + { + do { + codebuf << *funcstr++; + } while((*funcstr >= 'A' && *funcstr <= 'Z') + || (*funcstr >= 'a' && *funcstr <= 'z') + || (*funcstr >= '0' && *funcstr <= '9') + || *funcstr == '_'); + } + else + codebuf << *funcstr++; + } + } +} + +std::string ReplaceVars(const char* function, + const std::map<std::string, std::string>& var_trans) +{ + std::string result = function; + + for(std::map<std::string, std::string>::const_iterator + i = var_trans.begin(); + i != var_trans.end(); + ++i) + { + str_replace_inplace(result, i->first, i->second); + } + + return result; +} + +//std::string StringBuffer; +std::string TranslateString(const std::string& str) +{ + std::string val = str; + str_replace_inplace(val, std::string("/"), std::string("\"\"/\"\"")); + str_replace_inplace(val, std::string("+"), std::string("\"\"+\"\"")); + str_replace_inplace(val, std::string("*"), std::string("\"\"*\"\"")); + str_replace_inplace(val, std::string("x"), std::string("\"\"x\"\"")); + str_replace_inplace(val, std::string("&"), std::string("\"\"&\"\"")); + str_replace_inplace(val, std::string("("), std::string("\"\"(\"\"")); + str_replace_inplace(val, std::string(")"), std::string("\"\")\"\"")); + str_replace_inplace(val, std::string("pow"), std::string("\"\"pow\"\"")); + str_replace_inplace(val, std::string("sin"), std::string("\"\"sin\"\"")); + if(val[0] == '"') val.erase(0,1); else val.insert(val.begin(), '"'); + if(val[val.size()-1] == '"') val.erase(val.size()-1, 1); else val += '"'; + str_replace_inplace(val, std::string("\"\"\"\""), std::string("")); + return val; + /* + if(str.size() <= 6) + { + return '"' + str + '"'; + } + std::string keyword = str; + keyword += '\0'; + size_t p = StringBuffer.find(keyword); + if(p == StringBuffer.npos) + { + p = StringBuffer.size(); + StringBuffer += keyword; + } + char Buf[128]; + std::sprintf(Buf, "ts+%u", (unsigned)p); + return Buf; + */ +} +/* +void MakeStringBuffer(std::ostream& out) +{ + size_t pos = 26; bool quote = false; + out << "const char ts[" << StringBuffer.size() << "] = "; + for(size_t a=0; a < StringBuffer.size(); ++a) + { + //if(pos >= 70) { if(quote) { quote=false; out << '"'; } out << "\n"; pos = 0; } + if(!quote) { quote=true; out << '"'; ++pos; } + if(StringBuffer[a] == '\0') + { out << "\\0"; pos += 2; + if(a+1 < StringBuffer.size() + && std::isdigit(StringBuffer[a+1])) + { out << '"'; quote=false; ++pos; } + } + else + { out << StringBuffer[a]; pos += 1; + if(StringBuffer[a] == '/') + { out << '"'; quote=false; ++pos; } + } + } + if(quote) out << '"'; + out << ";\n"; +}*/ + +std::pair<std::string, std::string> + MakeFuncName(const std::string& testname) +{ +#if 0 + static unsigned counter = 0; + std::string result = "qZ"; + for(unsigned p = counter++; p != 0; p /= 63) + result += cbuf[p % 63]; + return result; +#else + std::string base = "cpp/" + testname; + + size_t p = base.rfind('/'); + std::string classname = base.substr(0, p); + std::string methodname = base.substr(p+1); + str_replace_inplace(classname, std::string("/"), std::string("_")); + str_replace_inplace(methodname, std::string("/"), std::string("_")); + // Change the method name to prevent clashes with + // with reserved words or the any namespace + if(isdigit(methodname[0])) + methodname.insert(0, "t"); + else + methodname[0] = (char)std::toupper(methodname[0]); + return std::make_pair(classname, methodname); +#endif +} + +void CompileTest(const std::string& testname, FILE* fp) +{ + char Buf[4096]={0}; + std::string linebuf; + + TestData test; + std::set<std::string> DataTypes; + + test.TestName = testname; + str_replace_inplace(test.TestName, std::string("tests/"), std::string("")); + + std::ostringstream declbuf; + + std::map<std::string, std::string> var_trans; + + std::string limited_to_datatype; + + unsigned linenumber = 0; + while(fgets(Buf,sizeof(Buf)-1,fp)) + { + ++linenumber; + const char* line = Buf; + while(*line == ' ' || *line == '\t') ++line; + std::strtok(Buf, "\r"); + std::strtok(Buf, "\n"); + + const char* backslash = std::strchr(line, '\\'); + if(backslash && backslash[1] == '\0') + { + linebuf = ""; + for(;;) + { + // Append the line, sans backslash + linebuf.append(line, backslash-line); + linebuf += ' '; + + if(!fgets(Buf,sizeof(Buf)-1,fp)) break; + ++linenumber; + const char* line = Buf; + while(*line == ' ' || *line == '\t') ++line; + std::strtok(Buf, "\r"); + std::strtok(Buf, "\n"); + backslash = std::strchr(line, '\\'); + + if(backslash && backslash[1] == '\0') + continue; + + // add the final, backslash-less line + linebuf += line; + break; + } + line = linebuf.c_str(); + } + else + { + // no backslash on the line + linebuf = Buf; + } + + const char* valuepos = std::strchr(line, '='); + if(valuepos) + { + ++valuepos; + while(*valuepos == ' ' || *valuepos == '\t') ++valuepos; + } + + switch(line[0]) + { + case '#': + continue; // comment line + case '\0': + continue; // blank line + case 'D': // test define condition + if(line[1] == 'E') + test.UseDegrees = true; + else if(valuepos) + test.IfDef = valuepos; + break; + case 'T': // list of applicable types + if(valuepos) + { + for(;;) + { + while(*valuepos == ' ') ++valuepos; + if(!*valuepos) break; + + const char* space = std::strchr(valuepos, ' '); + if(!space) space = std::strrchr(valuepos, '\0'); + std::string type(valuepos, space); + + DataTypes.insert(GetTypeFor(type)); + + valuepos = space; + } + + if(DataTypes.size() == 1) + limited_to_datatype = *DataTypes.begin(); + + test.DataTypes = DataTypes; + } + break; + case 'V': // variable list + if(valuepos) + { + test.ParamString = valuepos; + test.ParamAmount = test.ParamString.empty() ? 0 : 1; + + const char* begin = valuepos; + + std::vector<std::string> vars; + + for(; *valuepos; ++valuepos) + if(*valuepos == ',') + { + vars.push_back( std::string(begin,valuepos-begin) ); + begin = valuepos+1; + ++test.ParamAmount; + } + + if(begin != valuepos) + vars.push_back(begin); + + bool outputted_line_stmt = false; + + for(size_t a=0; a<vars.size(); ++a) + { + std::string oldvarname = vars[a]; + std::string newvarname = vars[a]; + bool needs_replacement = false; + for(size_t b=0; b<oldvarname.size(); ++b) + { + char c = oldvarname[b]; + if((c >= '0' && c <= '9') + || c == '_' + || (c >= 'A' && c <= 'Z') + || (c >= 'a' && c <= 'z')) continue; + needs_replacement = true; break; + } + if(needs_replacement) + { + static unsigned var_counter = 0; + std::ostringstream varnamebuf; + varnamebuf << "rvar" << var_counter++; + newvarname = varnamebuf.str(); + var_trans[oldvarname] = newvarname; + } + + if(!outputted_line_stmt) + { + outputted_line_stmt = true; + //declbuf << "#line " << linenumber << " \"" << testname << "\"\n"; + declbuf << " const Value_t"; + } + else + declbuf << ","; + declbuf << " &" << newvarname + << " = vars[" << a << "]"; + } + if(outputted_line_stmt) + declbuf << ";\n"; + } + break; + case 'R': // parameter value ranges + if(valuepos) + test.ParamValueRanges = valuepos; + break; + case 'F': // the function string + if(valuepos) + test.FuncString = valuepos; + break; + case 'C': // the C++ template function + if(valuepos) + { + std::string Replaced; + if(!var_trans.empty()) + { + Replaced = ReplaceVars(valuepos, var_trans); + valuepos = Replaced.c_str(); + } + + std::pair<std::string,std::string> + funcname = MakeFuncName(test.TestName); + test.TestFuncName = funcname.first+"::"+funcname.second; + + bool includes_mpfr = DataTypes.find("MpfrFloat") != DataTypes.end(); + bool unitype = DataTypes.size() == 1; + + //bool has_generic = false; + + if(!unitype || !includes_mpfr) + { + std::ostringstream declbuf1, codebuf1; + declbuf1 << declbuf.str(); + //declbuf1 << "#line " << linenumber << " \"" << testname << "\"\n"; + + const char* valuepos_1 = valuepos; + CompileFunction(valuepos_1, funcname.second, declbuf1, codebuf1, + limited_to_datatype); + + std::string code = codebuf1.str(); + std::string bodystr = + "{\n" + + declbuf1.str() + + " return " + code + ";\n" + "}\n"; + + if(limited_to_datatype.empty() || limited_to_datatype == "double") + { + define_sections[""] + .namespace_functions[funcname.first] + += test_declaration(funcname.second) + "\n" + bodystr; + //has_generic = true; + } + else + { + define_sections[GetDefinesFor(limited_to_datatype)] + .namespace_functions[funcname.first] += + test_specialized_declaration(funcname.second, limited_to_datatype) + + "\n" + bodystr; + } + } + else + { + // When it's mpfr-only + //class_declarations[funcname.first].first += + // test_declaration(funcname.second) + ";\n"; + } + + if(includes_mpfr) + { + std::ostringstream declbuf2, codebuf2; + declbuf2 << declbuf.str(); + //declbuf2 << "#line " << linenumber << " \"" << testname << "\"\n"; + + CompileFunction(valuepos, funcname.second, + declbuf2, codebuf2, "MpfrFloat"); + + if(codebuf2.str().find("mflit") != codebuf2.str().npos + || unitype) + { + std::string code = codebuf2.str(); + str_replace_inplace(code, std::string("MpfrFloat"), std::string("Value_t")); + + std::string bodystr2 = + "{\n" + + declbuf2.str() + + " return " + code + ";\n" + "}\n"; + + std::ostringstream out2; + + if(!test.IfDef.empty()) + out2 << "#if " << test.IfDef << "\n"; + + /*if(has_generic) + out2 << test_specialization(funcname.second, "MpfrFloat") << "\n"; + else*/ + out2 << test_specialized_declaration(funcname.second, "MpfrFloat") << "\n"; + out2 << bodystr2; + + if(!test.IfDef.empty()) + out2 << "#endif /* " << test.IfDef << " */\n"; + + define_sections["FP_TEST_WANT_MPFR_FLOAT_TYPE"] + .namespace_functions[funcname.first] += out2.str(); + } + } + } + break; + } + } + + for(std::set<std::string>::const_iterator + i = DataTypes.begin(); + i != DataTypes.end(); + ++i) + { + tests[*i].push_back(test); + } +} + +/* Asciibetical comparator, with in-string integer values sorted naturally */ +bool natcomp(const std::string& a, const std::string& b) +{ + size_t ap=0, bp=0; + while(ap < a.size() && bp < b.size()) + { + if(a[ap] >= '0' && a[ap] <= '9' + && b[bp] >= '0' && b[bp] <= '9') + { + unsigned long aval = (a[ap++] - '0'); + unsigned long bval = (b[bp++] - '0'); + while(ap < a.size() && a[ap] >= '0' && a[ap] <= '9') + aval = aval*10ul + (a[ap++] - '0'); + while(bp < b.size() && b[bp] >= '0' && b[bp] <= '9') + bval = bval*10ul + (b[bp++] - '0'); + if(aval != bval) + return aval < bval; + } + else + { + if(a[ap] != b[ap]) return a[ap] < b[ap]; + ++ap; ++bp; + } + } + return (bp < b.size() && ap >= a.size()); +} + +#include "../util/cpp_compress.hh" + +int main(int argc, char* argv[]) +{ + const char* outputFileName = 0; + std::ofstream outputFileStream; + + std::ostringstream out; + + std::vector<std::string> files; + + for(int a=1; a<argc; ++a) + { + if(std::strcmp(argv[a], "-o") == 0) + { + if(++a == argc) + { + std::cerr << "Expecting output file name after -o\n"; + return 1; + } + outputFileName = argv[a]; + outputFileStream.open(argv[a]); + if(!outputFileStream) + { + std::cerr << "Could not write to " << argv[a] << "\n"; + return 1; + } + continue; + } + + std::string fn ( argv[a] ); + if(fn.empty()) continue; + + if(fn[fn.size()-1] == '~') continue; // ignore backup files + if(fn[0] == '.') continue; // ignore special files + + files.push_back(fn); + } + + std::ostream& outStream = outputFileName ? outputFileStream : std::cout; + //const char* outStreamName = outputFileName ? outputFileName : "<stdout>"; + + std::sort(files.begin(), files.end(), natcomp); + + for(size_t a=0; a<files.size(); ++a) + { + FILE* fp = std::fopen(files[a].c_str(), "rt"); + if(!fp) + { + std::perror(files[a].c_str()); + continue; + } + CompileTest(files[a], fp); + fclose(fp); + } + + out << + "#ifdef FP_TEST_WANT_DOUBLE_TYPE\n" + " #define DBL_ONLY(p) p,\n" + "#else\n" + " #define DBL_ONLY(p)\n" + "#endif\n" + "\n" + "#ifdef FP_TEST_WANT_LONG_INT_TYPE\n" + " #define LNG_ONLY(p) p,\n" + "#else\n" + " #define LNG_ONLY(p)\n" + "#endif\n" + "\n" + "#define APP(x,y) x##y\n"; + for(std::map<std::string, std::pair<std::string,std::string> >::const_iterator + i = class_declarations.begin(); + i != class_declarations.end(); + ++i) + { + std::string decls = i->second.first + i->second.second; + define_sections[""].namespace_functions[i->first].insert(0, decls); + } + + ListTests(out); + + for(std::map<std::string, section_data>::const_iterator + i = define_sections.begin(); i != define_sections.end(); ++i) + { + const std::string type = GetTypeForDefine(i->first); + if(!i->first.empty()) + out << "\n#ifdef " << i->first << "\n"; + + out << NumConstDefines(type) << "\n"; + + if(i->first != "") out << "#define Value_t " + type + "\n"; + + out << i->second.definitions; + + for(std::map<std::string, std::string>::const_iterator + j = i->second.namespace_functions.begin(); + j != i->second.namespace_functions.end(); + ++j) + { + std::string nscontent = j->second; + str_replace_inplace(nscontent, std::string("\n"), std::string("\n ")); + + out << "namespace " << j->first << "\n" + "{\n" + " using namespace FUNCTIONPARSERTYPES;\n " + << nscontent << "\n}\n"; + } + + if(i->first == "") out << "#define Value_t " + type + "\n"; + + out << i->second.test_list; + out << "#undef Value_t\n"; + out << NumConstUndefines(type); + + if(!i->first.empty()) + out << "#endif /*" << i->first << " */\n"; + } + + //MakeStringBuffer(out); + //outStream << "extern const char ts[" << StringBuffer.size() << "];\n"; + + CPPcompressor Compressor; + + //outStream << out.str(); + outStream << Compressor.Compress(out.str()); + + return 0; +} diff --git a/tests/test_file_syntax.txt b/tests/test_file_syntax.txt new file mode 100644 index 0000000..f5aaa6a --- /dev/null +++ b/tests/test_file_syntax.txt @@ -0,0 +1,176 @@ +Each file documents a distinct function to test, and the conditions for testing. + +------------------------- +D=defined(CONSTANT1) && !defined(CONSTANT2) +------------------------- + +Optional. +This line can be used to specify compile-time conditions which +determine whether this rule should be tested at all. +If your line is "D=xxx", the rule will be handled +as if enclosed in "#if xxx" ... "#endif". + +This line, if used, must be indicated before the C line. + +------------------------- +T=d f ld mf li gi +------------------------- + +Mandatory! +A line beginning with "T=" describes which datatypes this rule applies to. + d=double + f=float + ld=long double + mf=mpfr float + li=long int + gi=gmp int + +------------------------- +DEG=true +------------------------- + +Optional. +This line, when exists, specifies that degrees conversion is to be +requested from fparser. In the C++ function you must do your own +degrees conversions. + + +------------------------- +V=x,y,z +------------------------- + +Mandatory! +This lists the parameters (variables) for the function. +The number of parameters is automatically deduced from this. +The variable names are to be written in a format accepted by fparser. +If they are not valid C++ variable names, make_tests will rename them +transparently. + +This line, must be indicated before the C line. + + +------------------------- +R=-100, 100, 0.5 +------------------------- + +Mandatory! +This specifies the minimum, the maximum, and the step value +that are used for iterating through the function parameters +in the testing procedure. + + +------------------------- +F=x+y+z +------------------------- + +Mandatory! +This specifies the fparser function to test. + +You can use \ to continue the function to the next line. + + +------------------------- +C=x+y+z +------------------------- + +Mandatory! +This specifies the C++ function expression that corresponds +the fparser function. You do not need to typecast your numeric +constants; casts will be automatically added by make_tests. + +You can use \ to continue the function to the next line. + +The expression must not be a full statement; make_tests will +automatically prefix it with "return " and add a ";" at the +end of it. + +------------------------ +Calling PCall functions in the C++ code +----------------------- +In order to call PCall functions in the C++ code, +use this syntax: + + userDefFuncSub({x+1, y-1}) + +This is equivalent to the fparser function Sub(x+1, y-1). + +make_tests will automatically translate this to code that +sets up an array for the function parameters, and will place +the expressions in that array, and pass the array pointer +to the function as a parameter. + + + +------------------------ +Using recursion in the C++ code +----------------------- +In order to recurse in the C++ code, +use this syntax: + + Eval({x+1, y-1}) + +This is equivalent to the fparser function eval(x+1, y-1). + +make_tests will automatically translate this to code that +sets up an array for the function parameters, and will place +the expressions in that array, and pass the array pointer +to the same function as a parameter. + + +------------------------ +Which tests go where +------------------------ + +01unit_operators: + These tests test each basic operator in the most + simple manner possible. The C++ functions used + to verify the operators should not use code that + depends on portions of fparser being implemented + correctly. + +02unit_functions: + These tests test each built-in function in the + most simple manner possble. The C++ functions used + to verify the operators should not use code that + depends on portions of fparser being implemented + correctly, aside from basic operators. + I.e. to test sin(), don't use fp_sin() to verify + it; verify it against math library's sin(), sinf(), + etc. directly. + +03unit_constants: + These tests verify that the fp_const_* functions + produce mathematically correct values. + +10optimizer_bytecode: + Unit tests for each bytecode optimization done + by the parser itself. + +11optimizer_constaddmul: + Unit tests for those bytecode optimizations done + by the parser itself, which pertain to the grouping + of numeric literal values. + +20optimizer_optimizations: + Testcases for categorigally each fpoptimizer optimization. + (Incomplete) + +21optimizer_trigcombinations: + This is a machine generated list of tests that stress + all combinations of sin/cos/tan/sinh/cos/tanh/exp + with exponents -2..+2 in multiplications and additions, + to catch any misoperations thereof. It is easy to + get them wrong, so an exhaustive testing is justified. + +50regressions: + Tests in this directory target specific bugs which + have been discovered. The test should contain nothing + but the minimal code to trigger the bug. + The test file should document the bug. + +99misc: + Put here tests which don't belong in other categories. + In the C++ functions, use the type-agnostic fp_* functions + to reduce the need to implement different versions for + each type. The validity of each fp_* function is expected + to have been verified in the unit tests. |