Suppose I have a sympy expression
e1 op e2
where op is any arithmetic comparison operator, such as <, >, <=,
I want to generate a C code
double f(x1,x2,...xn){
if (e1<=e2) return 0 else return 1;
}
where x1,...,x2 are free variables in either e1 or e2.
How can I use sympy.printing.ccode, or sympy.utlilities.codegen to simplify this code generation? Thanks for your idea.