473,395 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Tabulated values for a function

Hi,

This is not really a C/C++ question. Suppose I have a function double
f(double x) that takes a long time to compute. Is there a tool
available that would take this function and would generate C/C++ code
for this function which operates via tabulated values?
Thanks
Aaron Fude

Jul 22 '05 #1
4 2236
<aa*******@gmail.com> wrote...
This is not really a C/C++ question.
There is no such thing as "a C/C++ question". It's either a C question
or a C++ question.
Suppose I have a function double
f(double x) that takes a long time to compute. Is there a tool
available that would take this function and would generate C/C++ code
There is no such thing as "C/C++ code". It's either C code or it's C++
code.
for this function which operates via tabulated values?


There are several tools on the market that can do something like that.
They are OT here, however. Try alt.sci.math.mathematica.

V
Jul 22 '05 #2
aa*******@gmail.com wrote:
This is not really a C/C++ question.
Try sci.math.num-analysis.
Suppose I have a function double f(double x)
f(double x) that takes a long time to compute.
Is there a tool available that would take this function
and would generate C/C++ code for this function
which operates via tabulated values?


No.
I used Google

http://www.google.com/

to search for

+"interpolation" +"C++"

and I found lots of stuff including

http://www.mathtools.net/C_C__/Fitti...Interpolation/
Jul 22 '05 #3
aa*******@gmail.com wrote:
Hi,

This is not really a C/C++ question. Suppose I have a function double
f(double x) that takes a long time to compute. Is there a tool
available that would take this function and would generate C/C++ code
for this function which operates via tabulated values?
Thanks
Aaron Fude


Many complex functions are implemented as table lookups.
Some use interpolation others are direct lookups. Often
times, this is a trade of speed for memory / code space.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library

Jul 22 '05 #4

Thomas Matthews wrote:
aa*******@gmail.com wrote:
Hi,

This is not really a C/C++ question. Suppose I have a function double f(double x) that takes a long time to compute. Is there a tool
available that would take this function and would generate C/C++ code for this function which operates via tabulated values?
Thanks
Aaron Fude


Many complex functions are implemented as table lookups.
Some use interpolation others are direct lookups. Often
times, this is a trade of speed for memory / code space.


Hi Thomas,

Thank you for such a useful response. Do you know if "sin" is
implemented as a lookup in libm? In either case, can you point me to a
C/C++ example of a funciton implemented as a lookup with interpolation?
Uh, sorry, C or C++ example. :)

Thank you!

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
4
by: davario | last post by:
hi everyone, I'm doing a project and it requires comparing entries on a file. (the entries are separated by \r). i need to compare the first to the second, then to the third etc. the same thing...
17
by: MLH | last post by:
A97 Topic: If there is a way to preserve the values assigned to global variables when an untrapped runtime error occurs? I don't think there is, but I thought I'd ask. During development, I'm...
8
by: Chris A via AccessMonster.com | last post by:
I have an interesting problem that I have yet to come accross that I can't change data structure on because it is an export from filemaker I am reformatting for another dept. anyway. I have a table...
8
by: aleksandar.ristovski | last post by:
Hello all, I have been thinking about a possible extension to C/C++ syntax. The current syntax allows declaring a function that returns a value: int foo(); however, if I were to return...
4
by: chengsi | last post by:
Hi all, This is my first post, so please excuse if i am posting a silly question. I have an MS Access database and have created a tabulated form (where there are multiple lines, one for each...
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.