I modified simp-%if to delay simplification of the final two
arguments until after the first argument is simplified. Since sublis
simplifies after all subs are made and subst simplifies
along the way, we get:
(%i6) load("to_poly_solve_extra.lisp")$
(%i7) f : %if(x < 1, 5, log(x));
(%o7) %if(-(x-1)>0,5,log(x))
(%i8) sublis([x=0],f);
(%o8) 5
(%i9) subst([x=0],f);
log(0) has been generated.
I'm a sublis fan. Using GCL, my ten line sublis function
is slower than the Maxima version.
Barton