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 2006

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

Search the Archive

Behaviour of FindRoot

  • To: mathgroup at
  • Subject: [mg65096] Behaviour of FindRoot
  • From: dh <dh at>
  • Date: Tue, 14 Mar 2006 06:00:20 -0500 (EST)
  • Sender: owner-wri-mathgroup at

in a previous thread: "optimization nested in root-finding" the 
following as yet unanswered problem poped up (simplified):

f1[x1_] := (Print["x1=",x1];
FindRoot[f1[x] == 2., {x, 1}]

This will print "x1=x" showing that f1 was called with an unevaluated x, 
despite FindRoot having the Attribute "HoldAll". There is no other 
output from the Print statement

However, if we replace f1[x1_]  by f1[x1_Real]
we get the expected:


I think this has to do with compilation. Can anybody explain this?


  • Prev by Date: Mathlink with VC++ 8
  • Next by Date: Re: optimization nested in root-finding
  • Previous by thread: Re: Mathlink with VC++ 8
  • Next by thread: RE: Behaviour of FindRoot