From 7641450b2931d40c1a6da179a651e09b577b9d6a Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 5 Apr 2012 21:55:44 +0200 Subject: [PATCH] inpptree.c, fix differentiation of PTF_FLOOR PTF_CEIL and PTF_POW --- src/spicelib/parser/inpptree.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/spicelib/parser/inpptree.c b/src/spicelib/parser/inpptree.c index 7e3686f8e..1110ff26f 100644 --- a/src/spicelib/parser/inpptree.c +++ b/src/spicelib/parser/inpptree.c @@ -402,12 +402,12 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum) arg1 = mkf(PTF_USTEP, p->left); break; - case PTF_FLOOR: /* floor(u) */ - arg1 = mkf(PTF_FLOOR, p->left); + case PTF_FLOOR: /* naive: D(floor(u)) = 0 */ + arg1 = mkcon(0.0); break; - case PTF_CEIL: /* ceil(u) */ - arg1 = mkf(PTF_CEIL, p->left); + case PTF_CEIL: /* naive: D(ceil(u)) = 0 */ + arg1 = mkcon(0.0); break; @@ -505,8 +505,6 @@ static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum) mkb(PT_DIVIDE, arg1, p->left->left)), mkb(PT_TIMES, arg2, mkf(PTF_LN, p->left->left)))); } - arg2 = PTdifferentiate(p->left->left, varnum); - newp = mkb(PT_TIMES, arg1, arg2); return (newp); }