My actual question is a meta-question by the way. How do I write tests
when I don't know what the results should be,
You can't. You need to compute by hand, or some other means, the expected
result for some input. This should not be impossible. Check the result for
simple cases. For instance, if I were writing a sin function, I would check
sin(0) =0, sin(90)=1, and the like. Check examples from a textbook;
compute the expected result with Mathematica or other mathematical software.
OTOH, if the meta-question is how to *drive* development of a function with
tests, perhaps i would break the function to be developed as a composition
of functions, then test-drive those separately. Or maybe start with a crude
approximation and then refine it as needed. Perhaps your customer does not
need many significant digits. Perhaps you can get away with something
that's only guaranteed to be within the expected order of magnitude. Or use
a combination of both methods.
Any way you look at it, to do TDD you need to be able to come up with
examples of what the system should do given example inputs.
Matteo