FindFormula
✖
FindFormula
returns up to n best functions associated with properties prop1, prop2, etc.
Details and Options



- The data should be either an array of the form {{x1,y1},{x2,y2},…} or {y1,y2,…}, or a TimeSeries object.
- Data of the form {y1,y2,…} is equivalent to data of the form {{1,y1},{2,y2},…}.
- FindFormula[data,x,n,All] creates a Dataset object with all possible properties.
- Properties supported include:
-
"Score" internal score "Complexity" complexity of the function "Error" mean squared error All all the previous properties - The following options can be given:
-
PerformanceGoal Automatic aspect of performance to optimize RandomSeeding Automatic what seeding of pseudorandom generators should be done internally SpecificityGoal 1 - what formula complexity to seek
TargetFunctions All functions to consider TimeConstraint Automatic maximum time to be spent in finding the result - Possible settings for PerformanceGoal include:
-
"Speed" minimize the time spent in finding the result "Quality" try to find better results - Possible settings for SpecificityGoal include:
-
"Low" for simpler fits "High" for more complex functions s specificity between 0 (lowest) and Infinity (highest) - FindFormula[data,x,SpecificityGoal->Infinity] finds solutions that minimize the error.
- SpecificityGoal equal to 1 gives the best predictive performance.
- Possible settings for TargetFunctions include:
-
All all functions listed below { ,
,…}
functions - Possible functions for TargetFunctions are Plus, Times, Power, Sin, Cos, Tan, Cot, Log, Sqrt, Csc, Sec, Abs, and Exp.
- Possible settings for TimeConstraint include:
-
Automatic automatic t maximum t seconds - Possible settings for RandomSeeding include:
-
Automatic automatically reseed every time the function is called Inherited use externally seeded random numbers seed use an explicit integer or strings as a seed
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Make a table of values of the function x Sin[x]:

https://wolfram.com/xid/0bdo9jv7e-qkdyju

FindFormula finds a formula that generates the data:

https://wolfram.com/xid/0bdo9jv7e-g5ltz0

Plot the exponents of known Mersenne primes:

https://wolfram.com/xid/0bdo9jv7e-o7olbk

Find the best simple function describing the data:

https://wolfram.com/xid/0bdo9jv7e-tik57w

Visualize the fitted functions with the data:

https://wolfram.com/xid/0bdo9jv7e-qbnvqy

Scope (3)Survey of the scope of standard use cases
Generate data with normally distributed noise:

https://wolfram.com/xid/0bdo9jv7e-e6veqe

https://wolfram.com/xid/0bdo9jv7e-7qdhll

Find the first 5 best functions that approximate data:

https://wolfram.com/xid/0bdo9jv7e-d69ty3

Visualize the fitted functions with the data:

https://wolfram.com/xid/0bdo9jv7e-5nqq6f

Generate data with normally distributed noise:

https://wolfram.com/xid/0bdo9jv7e-bcuepe

https://wolfram.com/xid/0bdo9jv7e-8e5gp0

Visualize the dataset for the first 5 functions that approximate data:

https://wolfram.com/xid/0bdo9jv7e-ltmh0x

Generate data with normally distributed noise:

https://wolfram.com/xid/0bdo9jv7e-7pruse

https://wolfram.com/xid/0bdo9jv7e-cow9oj

Look at the first 300 fits and plot their score as functions of the errors and complexity for different settings of SpecificityGoal:

https://wolfram.com/xid/0bdo9jv7e-h6f505

https://wolfram.com/xid/0bdo9jv7e-sfm1w0


https://wolfram.com/xid/0bdo9jv7e-poy8j6

https://wolfram.com/xid/0bdo9jv7e-48flom

Visualize the first fitted function with the data:

https://wolfram.com/xid/0bdo9jv7e-disuev

Options (4)Common values & functionality for each option
PerformanceGoal (1)
Generate data with normally distributed noise:

https://wolfram.com/xid/0bdo9jv7e-g90tbp

https://wolfram.com/xid/0bdo9jv7e-wgjnz2

Find the best function that approximates data with its internal score:

https://wolfram.com/xid/0bdo9jv7e-4tb92p

Find the best function that approximates data using PerformanceGoal with its internal score:

https://wolfram.com/xid/0bdo9jv7e-o2sur8

Visualize the fitted functions with the data:

https://wolfram.com/xid/0bdo9jv7e-s21izq

RandomSeeding (1)
Generate data with normally distributed noise:

https://wolfram.com/xid/0bdo9jv7e-zx1wwl
Compare different evaluations of FindFormula and notice how they differ:

https://wolfram.com/xid/0bdo9jv7e-4boq0y

Use the option RandomSeeding to avoid having different results:

https://wolfram.com/xid/0bdo9jv7e-p7gw51

SpecificityGoal (1)
Generate data with normally distributed noise:

https://wolfram.com/xid/0bdo9jv7e-lc5hp9

https://wolfram.com/xid/0bdo9jv7e-ie4ell

Find the best functions that approximate data with their errors using different values of SpecificityGoal:

https://wolfram.com/xid/0bdo9jv7e-5kfduk

Visualize the fitted functions with the data:

https://wolfram.com/xid/0bdo9jv7e-293j9k

TargetFunctions (1)
Generate data with normally distributed noise:

https://wolfram.com/xid/0bdo9jv7e-shbafz

https://wolfram.com/xid/0bdo9jv7e-ygeyk8

Find the best function that approximates data:

https://wolfram.com/xid/0bdo9jv7e-c0k0xy

Find the best function that approximates data using TargetFunctions:

https://wolfram.com/xid/0bdo9jv7e-bzdvzc

Visualize the fitted functions with the data:

https://wolfram.com/xid/0bdo9jv7e-yaweeh

Applications (3)Sample problems that can be solved with this function
Population Growth (1)

https://wolfram.com/xid/0bdo9jv7e-0q4edf

Find the best function that describes data:

https://wolfram.com/xid/0bdo9jv7e-5uw4g3

Visualize the fitted function with the data:

https://wolfram.com/xid/0bdo9jv7e-psohi7

Find a fit for the first 100 prime numbers:

https://wolfram.com/xid/0bdo9jv7e-pqz6pn

https://wolfram.com/xid/0bdo9jv7e-riq4p1

Compare the fit with the data and with the next 200 primes:

https://wolfram.com/xid/0bdo9jv7e-4fduhq

https://wolfram.com/xid/0bdo9jv7e-yc7wzh

Differential Equation (1)
Orbital Mechanics (1)
Plot the orbital periods of planets vs. their semimajor axes:

https://wolfram.com/xid/0bdo9jv7e-5v2ul5

https://wolfram.com/xid/0bdo9jv7e-worbyj

Find the best simple function describing the orbital radius in terms of the orbital period:

https://wolfram.com/xid/0bdo9jv7e-t11533

Find the constant of proportionality:

https://wolfram.com/xid/0bdo9jv7e-w70f76

Compare with the exact formula given by Kepler's third law:

https://wolfram.com/xid/0bdo9jv7e-lc2jhq

The exact constant of proportionality has value:

https://wolfram.com/xid/0bdo9jv7e-0s9gnb

Compare with the different values from the orbital data directly:

https://wolfram.com/xid/0bdo9jv7e-2b8zaq

Wolfram Research (2015), FindFormula, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFormula.html (updated 2017).
Text
Wolfram Research (2015), FindFormula, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFormula.html (updated 2017).
Wolfram Research (2015), FindFormula, Wolfram Language function, https://reference.wolfram.com/language/ref/FindFormula.html (updated 2017).
CMS
Wolfram Language. 2015. "FindFormula." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/FindFormula.html.
Wolfram Language. 2015. "FindFormula." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/FindFormula.html.
APA
Wolfram Language. (2015). FindFormula. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindFormula.html
Wolfram Language. (2015). FindFormula. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindFormula.html
BibTeX
@misc{reference.wolfram_2025_findformula, author="Wolfram Research", title="{FindFormula}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/FindFormula.html}", note=[Accessed: 24-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_findformula, organization={Wolfram Research}, title={FindFormula}, year={2017}, url={https://reference.wolfram.com/language/ref/FindFormula.html}, note=[Accessed: 24-May-2025
]}