Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
FindFormula
  • See Also
    • FindDistribution
    • FindFit
    • LinearModelFit
    • NonlinearModelFit
    • FittedModel
    • GeneralizedLinearModelFit
    • Fit
    • ModelFit
    • Predict
    • FindSequenceFunction
    • MathematicalFunctionData
  • Related Guides
    • Curve Fitting & Approximate Functions
    • Scientific Data Analysis
    • Statistical Model Analysis
    • Optimization
    • Supervised Machine Learning
    • See Also
      • FindDistribution
      • FindFit
      • LinearModelFit
      • NonlinearModelFit
      • FittedModel
      • GeneralizedLinearModelFit
      • Fit
      • ModelFit
      • Predict
      • FindSequenceFunction
      • MathematicalFunctionData
    • Related Guides
      • Curve Fitting & Approximate Functions
      • Scientific Data Analysis
      • Statistical Model Analysis
      • Optimization
      • Supervised Machine Learning

FindFormula[data]

finds a pure function that approximates data.

FindFormula[data,x]

finds a symbolic function of the variable x that approximates data.

FindFormula[data,x,n]

finds up to n functions that approximate data.

FindFormula[data,x,n,prop]

returns up to n best functions associated with property prop.

FindFormula[data,x,n,{prop1,prop2,…}]

returns up to n best functions associated with properties prop1, prop2, etc.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Options  
PerformanceGoal  
RandomSeeding  
SpecificityGoal  
TargetFunctions  
Applications  
Population Growth  
Model Prime Numbers  
Differential Equation  
Orbital Mechanics  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • FindDistribution
    • FindFit
    • LinearModelFit
    • NonlinearModelFit
    • FittedModel
    • GeneralizedLinearModelFit
    • Fit
    • ModelFit
    • Predict
    • FindSequenceFunction
    • MathematicalFunctionData
  • Related Guides
    • Curve Fitting & Approximate Functions
    • Scientific Data Analysis
    • Statistical Model Analysis
    • Optimization
    • Supervised Machine Learning
    • See Also
      • FindDistribution
      • FindFit
      • LinearModelFit
      • NonlinearModelFit
      • FittedModel
      • GeneralizedLinearModelFit
      • Fit
      • ModelFit
      • Predict
      • FindSequenceFunction
      • MathematicalFunctionData
    • Related Guides
      • Curve Fitting & Approximate Functions
      • Scientific Data Analysis
      • Statistical Model Analysis
      • Optimization
      • Supervised Machine Learning

FindFormula

FindFormula[data]

finds a pure function that approximates data.

FindFormula[data,x]

finds a symbolic function of the variable x that approximates data.

FindFormula[data,x,n]

finds up to n functions that approximate data.

FindFormula[data,x,n,prop]

returns up to n best functions associated with property prop.

FindFormula[data,x,n,{prop1,prop2,…}]

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
    Allall the previous properties
  • The following options can be given:
  • PerformanceGoal Automaticaspect of performance to optimize
    RandomSeeding Automaticwhat seeding of pseudorandom generators should be done internally
    SpecificityGoal 1what formula complexity to seek
    TargetFunctions Allfunctions to consider
    TimeConstraintAutomaticmaximum 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
    sspecificity 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:
  • Allall functions listed below
    {f_(1),f_(2),…}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:
  • Automaticautomatic
    tmaximum t seconds
  • Possible settings for RandomSeeding include:
  • Automaticautomatically reseed every time the function is called
    Inheriteduse externally seeded random numbers
    seeduse an explicit integer or strings as a seed

Examples

open all close all

Basic Examples  (2)

Make a table of values of the function x Sin[x]:

Wolfram Language code: Table[{x, N[x Sin[x]]}, {x, 0, 4, .3}]

FindFormula finds a formula that generates the data:

Wolfram Language code: FindFormula[%, x]

Plot the exponents of known Mersenne primes:

Wolfram Language code: plot = ListLogPlot[mersenneexponents = MersennePrimeExponent[Range[48]]]

Find the best simple function describing the data:

Wolfram Language code: formula = FindFormula[Log[mersenneexponents], TargetFunctions -> {Power, Times}, SpecificityGoal -> "Low"]

Visualize the fitted functions with the data:

Wolfram Language code: Show[plot, LogPlot[Exp[formula[n]], {n, 1, 48}]]

Scope  (3)

Generate data with normally distributed noise:

Wolfram Language code: data = Table[{x, Sin[2x] + Cos[x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 1000]}];

Visualize the data:

Wolfram Language code: ListPlot[data]

Find the first 5 best functions that approximate data:

Wolfram Language code: fits = FindFormula[data, x, 5]

Visualize the fitted functions with the data:

Wolfram Language code: Show[ListPlot[data], Plot[fits, {x, -20, 60}, PlotRange -> All]]

Generate data with normally distributed noise:

Wolfram Language code: data = Table[{x, -x + 2Sin[x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 100]}];

Visualize the data:

Wolfram Language code: ListPlot[data]

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

Wolfram Language code: fit = FindFormula[data, x, 5, All]

Generate data with normally distributed noise:

Wolfram Language code: data = Table[{x, Sin[2x] + x Exp[Cos[x]] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 500]}];

Visualize the data:

Wolfram Language code: ListPlot[data]

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

Wolfram Language code: fit = FindFormula[data, x, 300, {"Complexity", "Error", "Score"}, TimeConstraint -> 20, PerformanceGoal -> "Quality", SpecificityGoal -> 1];
Wolfram Language code: errorcomplexity = fit[[All, 2]]; errorcomplexity = Select[errorcomplexity, #[[2]] < 20&]; ListPlot3D[errorcomplexity, Filling -> Bottom]
Wolfram Language code: fit2 = FindFormula[data, x, 300, {"Complexity", "Error", "Score"}, TimeConstraint -> 20, PerformanceGoal -> "Quality", SpecificityGoal -> Infinity];
Wolfram Language code: errorcomplexity = fit2[[All, 2]]; errorcomplexity = Select[errorcomplexity, #[[2]] < 200&]; ListPlot3D[errorcomplexity, Filling -> Bottom]

Visualize the first fitted function with the data:

Wolfram Language code: Show[ListPlot[data], Plot[fit[[1, 1]], {x, 0, 20}]]

Options  (4)

PerformanceGoal  (1)

Generate data with normally distributed noise:

Wolfram Language code: data = Table[{x, x Cos[2 x] + Sin[2 x] + x + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-3, 20}, 1000]}];

Visualize the data:

Wolfram Language code: ListPlot[data]

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

Wolfram Language code: fit = FindFormula[data, x, 1, "Score" ]

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

Wolfram Language code: fit2 = FindFormula[data, x, 1, "Score", PerformanceGoal -> "Quality" ]

Visualize the fitted functions with the data:

Wolfram Language code: Show[ListPlot[data], Plot[{First@fit, First@fit2}, {x, -20, 60}, PlotRange -> All]]

RandomSeeding  (1)

Generate data with normally distributed noise:

Wolfram Language code: data = Table[{x, Sin[2 + x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{-10, 10}, 500]}];

Compare different evaluations of FindFormula and notice how they differ:

Wolfram Language code: Table[FindFormula[data, x], 3]

Use the option RandomSeeding to avoid having different results:

Wolfram Language code: Table[FindFormula[data, x, RandomSeeding -> 1], 3]

SpecificityGoal  (1)

Generate data with normally distributed noise:

Wolfram Language code: data = Table[{x, x + RandomVariate[NormalDistribution[0, 2]]}, {x, RandomReal[{-3, 20}, 15]}];

Visualize the data:

Wolfram Language code: ListPlot[data]

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

Wolfram Language code: fits = Table[FindFormula[data, x, 1, "Error", SpecificityGoal -> i], {i, {"Low", "High"}}]

Visualize the fitted functions with the data:

Wolfram Language code: Table[Show[ListPlot[data], Plot[fits[[i, 1]], {x, -20, 60}, PlotRange -> All]], {i, 1, 2}]

TargetFunctions  (1)

Generate data with normally distributed noise:

Wolfram Language code: data = Table[{x, x + Log[2 x] + RandomVariate[NormalDistribution[0, 0.2]]}, {x, RandomReal[{0.1, 20}, 1000]}];

Visualize the data:

Wolfram Language code: ListPlot[data]

Find the best function that approximates data:

Wolfram Language code: fit = FindFormula[data, x]

Find the best function that approximates data using TargetFunctions:

Wolfram Language code: fit2 = FindFormula[data, x, TargetFunctions -> {Times, Log, Plus}]

Visualize the fitted functions with the data:

Wolfram Language code: Show[ListPlot[data], Plot[{fit, fit2}, {x, -3, 20}]]

Applications  (4)

Population Growth  (1)

Population growth in Poland:

Wolfram Language code: data = Entity["Country", "Poland"][EntityProperty["Country", "Population", {"Date" -> Interval[{DateObject[{1950}], DateObject[{2015}]}]}]]

Find the best function that describes data:

Wolfram Language code: fit = FindFormula[data, x]

Visualize the fitted function with the data:

Wolfram Language code: Show[DateListPlot[data["Path"], ...], Plot[fit, {x, AbsoluteTime@data["FirstTime"], AbsoluteTime@data["LastTime"]}]]

Model Prime Numbers  (1)

Find a fit for the first 100 prime numbers:

Wolfram Language code: primes = Table[Prime[n], {n, 100}];
Wolfram Language code: fit = FindFormula[primes, x]

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

Wolfram Language code: primesNext = Table[Prime[n], {n, 100, 300}];
Wolfram Language code: Show[ListPlot[primes], ListPlot[Transpose[{Range[100, 300], primesNext}], PlotStyle -> Red], Plot[fit, {x, 0, 300}, PlotStyle -> Gray], PlotRange -> All]

Differential Equation  (1)

Find a fit for the numerical solution of a differential equation:

Wolfram Language code: sol = First[y /. NDSolve[{y'[x] == y[x]Cos[x], y[0] == 1}, y, {x, -5, 300}]]; times = N[Range[-5, 600] / 9]; data = Transpose[{times, sol[times] + RandomReal[.005, Length[times]]}]; lp = ListPlot[data, PlotRange -> All]
Wolfram Language code: fit = FindFormula[data, x, 1, TargetFunctions -> {Exp, Sin, Cos}, RandomSeeding -> 1234]

Compare the fit with the data:

Wolfram Language code: Show[ListPlot[data], Plot[fit, {x, -20, 90}, PlotRange -> All]]

Orbital Mechanics  (1)

Plot the orbital periods of planets vs. their semimajor axes:

Wolfram Language code: data = EntityValue["Planet", {"SemimajorAxis", "OrbitPeriod"}];
Wolfram Language code: ListPlot[Thread[Callout[data, EntityList["Planet"]]]]

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

Wolfram Language code: formula = FindFormula[data, a, RandomSeeding -> 1234]

Find the constant of proportionality:

Wolfram Language code: formula /. a -> Quantity[1, "AstronomicalUnit"]

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

Wolfram Language code: kepler = FormulaData[{"KeplersThirdLaw", "Sun"}]

The exact constant of proportionality has value:

Wolfram Language code: Sqrt@UnitConvert[kepler[[2]] / QuantityVariable["a", "Length"] ^ 3, ("Days"^2/"AstronomicalUnit"^3)]

Compare with the different values from the orbital data directly:

Wolfram Language code: Sqrt@UnitConvert[(#2^2/#^3)&@@@data, ("Days"^2/"AstronomicalUnit"^3)]

See Also

FindDistribution  FindFit  LinearModelFit  NonlinearModelFit  FittedModel  GeneralizedLinearModelFit  Fit  ModelFit  Predict  FindSequenceFunction  MathematicalFunctionData

Related Guides

    ▪
  • Curve Fitting & Approximate Functions
  • ▪
  • Scientific Data Analysis
  • ▪
  • Statistical Model Analysis
  • ▪
  • Optimization
  • ▪
  • Supervised Machine Learning

History

Introduced in 2015 (10.2) | Updated in 2017 (11.2)

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).

CMS

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

BibTeX

@misc{reference.wolfram_2026_findformula, author="Wolfram Research", title="{FindFormula}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/FindFormula.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_findformula, organization={Wolfram Research}, title={FindFormula}, year={2017}, url={https://reference.wolfram.com/language/ref/FindFormula.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English