Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

[cppruntime] Adapted zero function tolerance #2829

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -12339,30 +12339,30 @@ template giveZeroFunc3(Integer index1, Exp relation, Text &varDecls /*BUFP*/,Tex
case LESS(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>]=(<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>]=(<%e1%> - 1e-6 - <%e2%>);
else
f[<%index1%>]=(<%e2%> - <%e1%> - 1e-9);
f[<%index1%>]=(<%e2%> - <%e1%> - 1e-6);
>>
case LESSEQ(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>] = (<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>] = (<%e1%> - 1e-6 - <%e2%>);
else
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-9);
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-6);
>>
case GREATER(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-9);
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-6);
else
f[<%index1%>] = (<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>] = (<%e1%> - 1e-6 - <%e2%>);
>>
case GREATEREQ(__) then
<<
if(_conditions[<%zerocrossingIndex%>])
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-9);
f[<%index1%>] = (<%e2%> - <%e1%> - 1e-6);
else
f[<%index1%>] = (<%e1%> - 1e-9 - <%e2%>);
f[<%index1%>] = (<%e1%> - 1e-6 - <%e2%>);
>>
else
<<
Expand Down