a draft of variable-sign code for fct_1d (still does not work correctly)