@@ -45,24 +45,24 @@ result = f(2.5) # Numerically evaluate at x = 2.5
4545
4646# Use the .n attribute to access fast numerical methods
4747numerical_roots = f.n.all_roots()
48- # or call f's n-prefixed methods directly to use variable precision numerical methods
49- roots = f.nsolve_all()
48+ # Call f's n-prefixed methods to use variable precision numerical methods
49+ precise_roots = f.nsolve_all(prec = 50 ) # 50 digits of accuracy
5050
51- # Beautiful printing options
52- f.print() # quick and easy printing
51+ # quick and easy printing
52+ f.print()
5353f.print(' latex' )
5454f.print(' mathematica_code' )
5555# or
5656print (f.print.latex()) # LaTeX output
57- print (f.print.ccode()) # Pretty ASCII art
57+ print (f.print.ccode()) # c code output
5858```
5959
6060
61- ## 🎯 Numerical Computing
61+ ## 🎯 Numerical Computing
6262
6363FunKit excels at bridging symbolic and numerical mathematics:
6464``` python
65- f = Expression(" x^3 - 2*x ^2 + x - 1" )
65+ f = Expression(" x^3 - 2x ^2 + x - 1" )
6666
6767# Root finding
6868all_roots = f.n.all_roots(bounds = (- 5 , 5 ))
@@ -105,13 +105,13 @@ expr = Expression("2x^2 + ln(|x-1|)")
105105from sympy import sin, cos
106106expr = Expression(sin(x) + cos(x))
107107
108- # Numerical methods via .n attribute
109- roots = expr.n.all_roots(bounds = (- 10 , 10 ))
110- integral = expr.n.quad(0 , 1 ) # Numerical integration
111-
112108# Symbolic operations
113109derivative = expr.diff(x)
114110expanded = expr.expand()
111+
112+ # Numerical methods via .n attribute
113+ roots = expr.n.all_roots(bounds = (- 10 , 10 ))
114+ integral = expr.n.quad(0 , 1 ) # Numerical integration
115115```
116116
117117
0 commit comments