I want to evaluate some function f(x) on many different intervals. I think that I don't want to rely on the Shape abstractions for this task, because I assume there is some performance penalty to passing y and z values that are never used.
Instead of doing something like this:
use fidget_core::{
context::Tree,
shape::EzShape,
};
use fidget_jit::JitShape;
let tree = Tree::x() + Tree::y();
let shape = JitShape::from(tree);
// Generate machine code to execute the tape
let tape = shape.ez_point_tape();
let mut eval = JitShape::new_point_eval();
// This calls directly into that machine code!
let (r, _trace) = eval.eval(&tape, 0.1, 0.3, 0.0)?;
assert_eq!(r, 0.1 + 0.3);
... I think I want to do something like this:
use fidget::context::{Context, Tree};
use fidget::eval::{TracingEvaluator};
use fidget::jit::{JitIntervalEval, JitTracingFn};
use fidget::types::Interval;
fn main() {
let tree = (Tree::x().square() - 1.0).square() + 0.6*Tree::x() + 2.0;
let mut ctx = Context::new();
let root = ctx.import(&tree);
let mut interval_evaluator = JitIntervalEval::default();
let result = interval_evaluator.eval(&_what_, &[Interval::new(1.0,2.0)]);
}
Is it intended to be possible to use Function types directly? Could the docs in fidget_jit be improved?
I want to evaluate some function f(x) on many different intervals. I think that I don't want to rely on the
Shapeabstractions for this task, because I assume there is some performance penalty to passing y and z values that are never used.Instead of doing something like this:
... I think I want to do something like this:
Is it intended to be possible to use Function types directly? Could the docs in fidget_jit be improved?