How is the derivative of a f(x) typically calculated programmatically to ensure maximum accuracy?
I am implementing the Newton-Raphson method, and it requires taking of the derivative of a function.

Asked By vehomzzz

How is the derivative of a f(x) typically calculated programmatically to ensure maximum accuracy?
I am implementing the Newton-Raphson method, and it requires taking of the derivative of a function.

Asked By vehomzzz

How is the derivative of a f(x) typically calculated programmatically to ensure maximum accuracy?
I am implementing the Newton-Raphson method, and it requires taking of the derivative of a function.

Asked By vehomzzz

Is there any predefined function in c++ to check whether the number is square of any number and same for the cube..

Asked By d3vdpro

Is there any predefined function in c++ to check whether the number is square of any number and same for the cube..

Asked By d3vdpro

i am looking for a sample code implementation on how to invert a 4x4 matrix. i know there is gaussian eleminiation, LU decomposition, etc. but instead of looking at them in detail i am really just looking for the code to do this.
language ideally C++, da...

Asked By clamp

i am looking for a sample code implementation on how to invert a 4x4 matrix. i know there is gaussian eleminiation, LU decomposition, etc. but instead of looking at them in detail i am really just looking for the code to do this.
language ideally C++, da...

Asked By clamp

What's the best way to represent a 128-bit number in C++? It should behave as closely to the built-in numeric types as possible (i.e. support all the arithmetic operators, etc).
I was thinking of building a class that had 2 64 bit or 4 32 bit numbers. Or...

Asked By David Coufal

Is there a standard and/or portable way to represent the smallest negative value (e.g. to use negative infinity) in a C(++) program?
DBL_MIN in float.h is the smallest positive number.

Asked By Will

Is there a standard and/or portable way to represent the smallest negative value (e.g. to use negative infinity) in a C(++) program?
DBL_MIN in float.h is the smallest positive number.

Asked By Will

/**
* Returns a number between kLowerBound and kUpperBound
* e.g.: Wrap(-1, 0, 4); // Returns 4
* e.g.: Wrap(5, 0, 4); // Returns 0
*/
int Wrap(int const kX, int const kLowerBound, int const kUpperBound)
{
// Suggest an implementation?
}...

Asked By Eddie Parker

I was wondering if there were statistics functions built into math libraries that are part of the standard C++ libraries like cmath. If not, can you guys recommend a good stats library that would have a cumulative normal distribution function? Thanks in a...

Asked By Tyler Brock

How do I raise a number to a power?
2^1
2^2
2^3
etc...

Asked By user98188

What's the easiest way to compute a 3x3 matrix inverse?
I'm just looking for a short code snippet that'll do the trick for non-singular matrices, possibly using Cramer's rule. It doesn't need to be highly optimized. I'd prefer simplicity over speed. I'd...

Asked By batty

I need an algorithm to find all of the subsets of a set where the number of elements in a set is n.
S={1,2,3,4...n}
Edit: I am having trouble understanding the answers provided so far. I would like to have step-by-step examples of how the answers work ...

Asked By Rahul Vyas

I'd like to implement a Bézier curve. I've done this in C# before, but I'm totally unfamiliar with the C++ libraries. How should I go about creating a quadratic curve?
void printQuadCurve(float delta, Vector2f p0, Vector2f p1, Vector2f p2);
Clearly we'...

Asked By Nick Bolton

I have pitch, roll, and yaw angles. How would I convert these to a directional vector?
It'd be especially cool if you can show me a quaternion and/or matrix representation of this!

Asked By Polaris878

I want a function that returns -1 for negative numbers and +1 for positive numbers.
http://en.wikipedia.org/wiki/Sign_function
It's easy enough to write my own, but it seems like something that ought to be in a standard library somewhere.
Edit: Specifica...

Asked By batty

I want a function that returns -1 for negative numbers and +1 for positive numbers.
http://en.wikipedia.org/wiki/Sign_function
It's easy enough to write my own, but it seems like something that ought to be in a standard library somewhere.
Edit: Specifica...

Asked By batty

It seems that many projects slowly come upon a need to do matrix math, and fall into the trap of first building some vector classes and slowly adding in functionality until they get caught building a half-assed custom linear algebra library, and depending...

Asked By Catskul