Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

FindRoot and Compile

  • To: mathgroup at
  • Subject: [mg46854] FindRoot and Compile
  • From: Matthias Gottschalk <gottschalk at>
  • Date: Fri, 12 Mar 2004 02:02:40 -0500 (EST)
  • Sender: owner-wri-mathgroup at

The following used to work in 4.2

y = Compile[{x}, x^2 - 2 == 0]

FindRoot[y[x], {x, .9}]

{x -> 1.41421}

With 5.01 I get the Message:

CompiledFunction::cfsa: "Argument x at position 1 should be a 
machine-size real number"

In this case I did not get the trick with_?NumericQ to work . Maybe I 
am not doing it correctly.
Any suggestions?



PD Dr. Matthias Gottschalk
Projektbereich 4.1
14473 Potsdam

tel/fax  +49 (0) 331 288-1418/1402

  • Prev by Date: Re: Decent Reference Guide?
  • Next by Date: Re: Creating a symmetric matrix
  • Previous by thread: Re: mathematica and image... help me please
  • Next by thread: Re: FindRoot and Compile