[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Symbolica package warning: Using rat() heuristics for double-precisi

From: Doug Stewart
Subject: Re: Symbolica package warning: Using rat() heuristics for double-precision input (is this what you wanted?)
Date: Fri, 17 Feb 2017 14:14:33 -0500

On Feb 17, 2017 12:44 PM, "Colin Macdonald" <address@hidden> wrote:
On 17/02/17 08:18, Doug Stewart wrote:
    I am thinking of putting this on the wiki.

Good idea!  I can help edit.

But first, the essential pattern here is:

1.  Do a symbolic calculation (in this case, a derivative)
2.  Evaluate that result for double values.

"subs" is not really the right tool for this.  It makes symbolic substitutions.

Perhaps the right pattern here is:

>> df = diff(...)
>> dfh = function_handle(df)
>> dfh(3.1415927)

Here "dfh" is a regular plain-old Octave anonymous function, can be evaluated efficiently for doubles, etc.

Note: you can also write this as "dfh = matlabFunction(df)" for compatibility with the Matlab Symbolic Toolbox.

There is some discussion about all this in


I already did the wiki before I saw this.
If you want  to change it go-ahead, if you want me to change something then let me know. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]