Disponible
Numeric equation solver.
`NSolve` finds numeric roots, and its real-restricted form can stop before converging - returning a value that looks like an exact answer and is wrong several digits earlier than machine precision: ```wolfram NSolve[E^x - x == 7, x, Reals] (* {{x -> -7.}} *) Abs[(E^x - x - 7) /. x -> -7.] (* 0.000911... - not a root *) FindRoot[E^x - x == 7, {x, -7}] (* {x -> -6.999087285366495} - the root *) ``` The machinery for the right answer is present; this path just stops early. So check the residual of every root before using it, and polish with `FindRoot` from the returned value when the residual is not near zero: ```wolfram root = x /. First[NSolve[E^x - x == 7, x, Reals]]; Chop[Abs[(E^x - x - 7) /. x -> root], 10^-6] (* 0 means converged *) ``` Compare the residual against a tolerance with `Chop`, never against zero with `==`: see `Equal` for why an exact comparison on machine numbers reports `False` even for a converged root.
Verificable de forma independiente: una respuesta de esta función se vuelve a derivar por otra vía y se compara; el taller y la herramienta verify lo hacen automáticamente, así una respuesta errónea se detecta en lugar de confiar en ella. Historial →