Monografías Plus      Agregar a favoritos      Ayuda      Português      Ingles     

Cálculo aproximado de las integrales definidas de las funciones derivables

Enviado por Aladar Peter Santha





Monografias.com
R i 2 2 2 1 Cálculo aproximado da las integrales definidas de las funciones derivables. Aladar Peter Santha Résumé: b Dans cet article on expose le calcule de l’integral I f ( x)dx d’une fonction (2m+1)-fois a derivable sur l’interval a, b . Si les points xi i 1,? , 2 p 1 divisent l’interval en 2p parties de la même longeur h (b a) /(2 p) , alors I = 2h p 1 i=0 f x2i 1 + 2 h3 3! p i=1 f" x2i 1 +?+ 2 h2m+1 2m 1 ! p i=1 f 2m x2i 1 R , oú x [a, b] et f ( 2 m 1) ( x) M 2 m 2 b a M 2m 2 ! 2 p 2 m 1 On expose aussi la programation de ces calcules a partir les derivées calculées d’une maniére simbolique ou approchée. ================================================================= Si f es una función continua en el intervalo a, b entonces existen varios métodos numéricos para el cálculo de la integral definida: b I = f(x)dx . (1) a La mayoría de estos métodos utilizan solamente los valores de la función f que han sido calculados para ciertos puntos del intervalo a, b . Suponiendo que la función f es (2m+1) - veces derivable en el intervalo a, b y considerando la siguiente división del intervalo a, b , a x0 x1 x2 ? x2 p b xi+1 xi = t = , sobre cada uno de los intervalos: b a 2p 0, 1, 2 , ? ,2 p 1 x2i 2 , x2i i 1, 2 , ? , p , la función se aproximará por el polinomio Taylor de grado 2m, asociado a la función f en el punto x2i 1 . Así, para x x2i 2 , x2i f(x)= 2m k=0 f (k) x2i k! 1 x x2i+1 k + f (2m+1) ci 2m 1 ! x x2i 1 2 m 1 , donde ci depende de x y está comprendido entre x y x2i 1 . Por tanto, I 2i 1 = x 2i x2 i f(x)dx = 2m x2 i k=0 x2 i f (k) x2i k! 1 x x2i 1 k dx + R2i 1 , donde R2i 1 = x2 i x2 i f (2m+1) ( ci ) 2m 1 ! x x2i 1 2m+1 dx . A continuación,

Monografias.com
2 1 1 1 1 1 p 1 (4) (4) (7) 38 es 8 . 2 I 2i 1 = 2m k=0 f (k) x2i 1 k 1 ! x x2i 1 k 1 x 2i x 2i + R2i 1 . Luego, puesto que x x2i 1 k 1 x 2i x 2i 2 = x2i x2i 1 k+1 x2i x2i 1 k+1 = t k+1 ( t )k+1 = 0 2 t k+1 si k es impar si k es par , tendremos I 2i 1 = 2tf x2i + 2 t 3 3! f" x2i +?+ 2 t 2m+1 2m f x2i 2m 1 ! + R2i , y así I I1 I 3 ? I 2 p 1 , es decir I 2t p i=1 f x2i 1 + 2 t 3 3! p i 1 f" x2i 1 +?+ 2 t 2m+1 2m 1 ! p i f 2 m x2i 1 (2) , donde p R = R2i 1 (3) i 1 Si la función f 2m 1 está acotada sobre el intervalo a, b , es decir, , para cualquier x a, b , entonces f 2 m 1 x M R p i 1 R2i 1 2M 2m 1 ! p x2 i i 1 x2 i x x2i 1 2 m 1 dx 2M 2m 1 ! p i=1 x 2 m 2 x2i 1 2m 2 x2 i x2 i 2M 2m 2 ! i 1 x2i x2i 1 2 m 2 2pM 2m+2 t 2m 2 ! Ejemplo 1: Sea f la función definida por M b a 2 m 1 2 p 2m 2 ! 2 m 2 (5) f x = E xp 0.5x 2 , y sean a 0 , b siguientes: 2 y m 3 . Las derivadas de orden 2, 4, 6 y 7 de la función f tienen las expresiones f" (x)= ( x2 1)Exp 0.5x 2 f (x)= ( x4 6 x2 + 3) E xp 0.5x 2 (6) f (x)= ( x6 15 x4 + 45 x2 15) E xp 0.5x 2 f (x)= ( x7 + 21 x5 108 x3 + 111x ) Exp 0.5x 2 Construyendo la gráfica de la función y f ( 7 ) x por ordenador, se observa que M una cota superior de esta función en el intervalo 0,2 y así para x 0,2 y 2 p 60 , tendremos R 38 2 607 8! 0.0000000000000861875? 10 13 Para calcular la integral, el código Visual-Basic es la siguiente:

Monografias.com
3 Public Function f(ByVal x As Double) As Double f x = E xp 0.5 * x * x End Function ‘-------------------------------------------------------- Public Function f2(ByVal x As Double) As Double f 2( x) = (x ^2 1) Exp 0.5 * x * x End Function ‘--------------------------------------------------------------------------- Public Function f4(ByVal x As Double) As Double f 4(x)= (x ^4 6 * x^2 + 3) E xp 0.5 * x * x End Function ‘----------------------------------------------------------------------- Public Function f6(ByVal x As Double) As Double f 6(x)= (x ^6 15*^4 + 45 * x^2 15) E xp 0.5 * x * x End Function ‘--------------------------------------------------------------------------------------------------------------- Public Function MST6(ByVal a As Double, ByVal b As Double, ByVal np As Integer) As String Dim i As Integer, s As Double, d As Double, a1 As Double, p As Double Dim s0 As Double, s2 As Double, s4 As Double, s6 As Double Dim j As Integer, sa As Double, sb As Double, n1 As Integer '----- Cálculo de la integral For j = 1 To 2 s0 = 0: s2 = 0: s4 = 0: s6 = 0: s = 0 If j = 1 Then n1 = np Else n1 = 2 * np d = (b - a) / n1: p = n1 / 2: a1 = a + d For i = 1 To p s0 = s0 + f(a1) s2 = s2 + f2(a1) s4 = s4 + f4(a1) s6 = s6 + f6(a1) a1 = a1 + 2 * d Next i s = 2 * d * s0 + (d ^ 3 / 3) * s2 + (d ^ 5 / 60) * s4 + (d ^ 7 / 2520) * s6 If j = 1 Then sa = s Else sb = s Next j MST6 = precision(sa, sb) End Function ‘----------------------------------------------------------------------------------------------------------------------- Public Function precision(ByVal t1 As Double, ByVal t2 As Double) As String Dim se As Double, sf As Double, sd As Double, sg As Double Dim p As Integer, t As Double, k As Integer, i As Integer Dim sol As String, rc As String p = Len(Str$(Fix(t1))) - 1: rc = Chr$(13) + Chr$(10) If t1 = t2 Then sol = "I = " + RutinaEdicion(t1) Else If Fix(t1) <> Fix(t2) Then sol = "I = " + RutinaEdicion(t1) sol = sol + rc + rc sol = sol + "Doblando el número de los nodos," + rc + rc sol = sol + "I = " + RutinaEdicion(t2) Else se = t1: sf = t2: sd = 1: k = 1 Do se = se * 10: sf = sf * 10 If Fix(se) <> Fix(sf) Then sg = Fix(se)

Monografias.com
4 Exit Do Else If k = 15 - p + 1 Then sg = Fix(se) Exit Do Else k=k+1 End If End If Loop For i = 1 To k sd = sd * 10 Next i t = sg / sd sol = "I = " + RutinaEdicion(t) End If End If precision = sol End Function ‘------------------------------------------------------------------------------------------------------ Public Function RutinaEdicion(ByVal t As Double) As String Dim u As String If Abs(t) < 1 Then If t < 0 Then u = u + "- 0" Else u = u + "0" If t <> 0 Then u = u + Str$(Abs(t)) Else u = u + Str$(t) End If RutinaEdicion = u End Function Dividiendo el intervalo 0,2 en np 34 partes iguales, el código de arriba devuelve el siguiente valor de la integral: I 1.1962880133 2261 (6) , que tiene todas sus cifras exactas, excepto la última que esta redondeada. Si el cálculo manual de las derivadas es laborioso, para hallar el valor de la integral se pueden utilizar solamente las derivadas de orden 2 y 4 ó solamente la derivada de orden 2, con las funciones siguientes: Public Function MST4(ByVal a As Double, ByVal b As Double, ByVal np As Integer) As String Dim i As Integer, s As Double, d As Double, a1 As Double Dim s0 As Double, s2 As Double, s4 As Double, p As Double Dim j As Integer, sa As Double, sb As Double, n1 As Integer ' ----- Cálculo de la integral For j = 1 To 2 If j = 1 Then n1 = np Else n1 = 2 * np s0 = 0: s2 = 0: s4 = 0: s = 0 d = (b - a) / n1: p = n1 / 2: a1 = a + d For i = 1 To p s0 = s0 + f(a1) s2 = s2 + f2(a1) s4 = s4 + f4(a1) a1 = a1 + 2 * d Next i s = 2 * d * s0 + (d ^ 3 / 3) * s2 + (d ^ 5 / 60) * s4 If j = 1 Then sa = s Else sb = s Next j MST4 = precision(sa, sb)

Monografias.com
I 5 End Function ‘---------------------------------------------------------------------------------------------------------------------- Public Function MST2(ByVal a As Double, ByVal b As Double, ByVal np As Integer) As String Dim i As Integer, s As Double, d As Double, a1 As Double Dim s0 As Double, s2 As Double, p As Double Dim j As Integer, sa As Double, sb As Double, n1 As Integer '----- Cálculo de la integral For j = 1 To 2 If j = 1 Then n1 = np Else n1 = 2 * np s0 = 0: s2 = 0: s = 0 d = (b - a) / n1: p = n1 / 2: a1 = a + d For i = 1 To p s0 = s0 + f(a1) s2 = s2 + f2(a1) a1 = a1 + 2 * d Next i s = 2 * d * s0 + (d ^ 3 / 3) * s2 If j = 1 Then sa = s Else sb = s Next j MST2 = precision(sa, sb) End Function Para alcanzar la misma precisión que en el apartado (6), con la función MST4 se debería dividir el intervalo 0,2 en np 148 partes iguales, y con la función MST2 se debería dividir el mismo intervalo en np 1350 partes iguales. En el caso cuando el cálculo de las derivadas es complicada y necesita mucho tiempo, se podría utilizar la función siguiente, que emplea el cálculo aproximado de las derivadas de orden superior: Public Function MST4B(ByVal a As Double, ByVal b As Double, ByVal np As Integer) As String Dim s0 As Double, s2 As Double, s4 As Double, p As Integer Dim i As Integer, s As Double, d As Double, a1 As Double, h As Double Dim j As Integer, sa As Double, sb As Double, n1 As Integer '----- Cálculo de la integral For j = 1 To 2 If j = 1 Then n1 = np Else n1 = 2 * np s0 = 0: s2 = 0: s4 = 0: s = 0 d = (b - a) / n1: p = n1 / 2: a1 = a + d For i = 1 To p s0 = s0 + f(a1) h = 0.0000001 s2 = s2 + (f(a1 + 2 * h) - 2 * f(a1 + h) + f(a1)) / (h ^ 2) h = 0.0001 s4 = s4 + (f(a1 + 4 * h) - 4 * f(a1 + 3 * h) + 6 * f(a1 + 2 * h) - 4 * f(a1 + h) + f(a1)) / (h ^ 4) a1 = a1 + 2 * d Next i s = 2 * d * s0 + (d ^ 3 / 3) * s2 + (d ^ 5 / 60) * s4 If j = 1 Then sa = s Else sb = s Next j MST4B = precision(sa, sb) End Function Calculando la integral definida de la función (5) entre los límites a 0 y b dividiendo el intervalo en 1000 partes iguales, se obtiene el resultado: 1.196288017 , donde todas las cifras son exactas, excepto la última. 2 con la funcione MST4B, Si la función es integrable en el intervalo I a,b) pero no es derivable en un número finito de puntos

Monografias.com
6 ci i 1, ? , k del intervalo I , entonces b f x dx c1 f x dx ? ci f x dx ? b f x dx a a ci 1 ck A continuación se exponen funciones para el cálculo de las integrales definidas de las funciones derivables, que utilizan los cálculos con los enteros y decimales largos, el cálculo de las funciones elementales con precisión grande y el cálculo aproximado de las derivadas de orden superior. Naturalmente esto hará que los cálculos duren más tiempo. Sin embargo, en el futuro se espera una considerable aumento de la velocidad de los ordenadores y entonces estas funciones serán más rápidas y podrían sobrepasar la precisión de los métodos habituales actuales. Public Function MST2C(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim i As Integer, s As String, d As String, a1 As String, x(2) As String Dim s0 As String, s2 As String, p As Integer, n As Integer, h As String Dim sx As String, pr As Integer, sb As String, nn(2) As String Dim j As Integer, sa As String n=7 ' pr es la precisión en los cálculos con decimales '----- Cálculo de la integral nn(1) = Mid$(Str$(Abs(np)), 2): pr = 16 x(1) = nn(1): x(2) = "2": nn(2) = Multiplicar(x(), n) For j = 1 To 2 s0 = "0": s2 = "0": s = "0" x(1) = bx: x(2) = ax: x(1) = Restar(x(), n): x(2) = nn(j) d = DividirDec(x(), 12, n): x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) p = Val(nn(j)) / 2 For i = 1 To p x(1) = s0: x(2) = g(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = g2(a1): s2 = SumarDec(x(), n) x(1) = d: x(2) = "2": x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n) If j = 1 Then sa = s Else sb = s Next j MST2C = PrecisionString(sa, sb) End Function ‘=========================================================================== Public Function MST4C(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim s0 As String, s2 As String, s4 As String, p As Integer, x(2) As String Dim i As Integer, s As String, d As String, a1 As String, nn(2) As String Dim j As Integer, sa As String, sb As String, n As Integer Dim pr As Integer n=7 ' pr es la precisión en los cálculos con decimales '----- Cálculo de la integral nn(1) = Mid$(Str$(Abs(np)), 2): pr = 16 x(1) = nn(1): x(2) = "2": nn(2) = Multiplicar(x(), n) For j = 1 To 2 s0 = "0": s2 = "0": s4 = "0": s = "0" x(1) = bx: x(2) = ax: x(1) = RestarDec(x(), n): x(2) = nn(j) d = DividirDec(x(), pr, n): p = Val(nn(j)) / 2 x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) For i = 1 To p x(1) = s0: x(2) = g(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = g2(a1): s2 = SumarDec(x(), n)

Monografias.com
7 x(1) = s4: x(2) = g4(a1): s4 = SumarDec(x(), n) x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "60" x(1) = DividirDec(x(), pr, n): x(2) = s4: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n) If j = 1 Then sa = s Else sb = s Next j MST4C = PrecisionString(sa, sb) End Function ‘========================================================================= Public Function MST6C(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim s0 As String, s2 As String, s4 As String, s6 As String, x(2) As String Dim i As Integer, s As String, d As String, a1 As String, pr As Integer, nn(2) as String Dim j As Integer, sa As String, sb As String, n As Integer, p As Integer n=7 ' pr es la precisión en los cálculos con decimales '----- Cálculo de la integral nn(1) = Mid$(Str$(Abs(np)), 2): pr = 16 x(1) = nn(1): x(2) = "2": nn(2) = Multiplicar(x(), n) For j = 1 To 2 s0 = "0": s2 = "0": s4 = "0": s6 = "0": s = "0" x(1) = bx: x(2) = ax: x(1) = RestarDec(x(), n): x(2) = nn(j) d = DividirDec(x(), pr, n): p = Val(nn(j)) / 2 x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) For i = 1 To p x(1) = s0: x(2) = g(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = g2(a1): s2 = SumarDec(x(), n) x(1) = s4: x(2) = g4(a1): s4 = SumarDec(x(), n) x(1) = s6: x(2) = g6(a1): s6 = SumarDec(x(), n) x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "60" x(1) = DividirDec(x(), pr, n): x(2) = s4: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "7": x(1) = PotenciasDec(x(), n): x(2) = "2520" x(1) = DividirDec(x(), pr, n): x(2) = s6: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n) If j = 1 Then sa = s Else sb = s Next j MST6C = PrecisionString(sa, sb) End Function ‘===================================================================== Public Function PrecisionString(ByVal sa As String, ByVal sb As String) As String Dim lsa As Integer, i As Integer, x(2) As String, n As Integer, z As String, sol As String Dim lsb As Integer, intsa As String, intsb As String, frsa As String, frsb As String n = 7: lsa = Len(sa): lsb = Len(sb) For i = 1 To lsa z = Right$(Left$(sa, i), 1) If z = "." Then intsa = Left$(sa, i - 1): frsa = Right$(sa, lsa - i) Exit For End If Next i For i = 1 To lsb

Monografias.com
8 z = Right$(Left$(sb, i), 1) If z = "." Then intsb = Left$(sb, i - 1): frsb = Right$(sb, lsb - i) Exit For End If Next i If intsa <> intsb Then sol = intsa Else For i = 1 To Len(frsa) If Right$(Left$(frsa, i), 1) <> Right$(Left$(frsb, i), 1) Then sol = intsa + "." + Left$(frsa, i - 1) Exit For End If Next i End If PrecisionString = sol End Function ‘ ====================================================== Public Function g(ByVal x0 As String, pr As Integer) As String Dim u As String, x(2) As String, n As Integer n=7 x(1) = x0: x(2) = x0: x(1) = MultiplicarDec(x(), n): x(2) = "-0.5" u = MultiplicarDec(x(), n) g = ExpP(u, pr) End Function ‘ ======================================================== Public Function g2(ByVal x0 As String) As String Dim h As String, sx As String, x(2) As String Dim b(2) As String, n As Integer, pr As Integer n = 7: h = "0.000000000001": pr = 2 * (Len(h) - 2) + 16 b(0) = x0 x(1) = b(0): x(2) = h: b(1) = SumarDec(x(), n) x(1) = b(1): x(2) = h: b(2) = SumarDec(x(), n) x(1) = "-2": x(2) = g(b(1), pr): sx = MultiplicarDec(x(), n) x(1) = sx: x(2) = g(b(0), pr): sx = SumarDec(x(), n) x(1) = sx: x(2) = g(b(2), pr): sx = SumarDec(x(), n) x(1) = h: x(2) = "2": x(2) = PotenciasDec(x(), n): x(1) = sx g2 = DividirDec(x(), 16, n) End Function ‘ ========================================================== Public Function g4(ByVal x0 As String) As String Dim h As String, sx As String, x(2) As String Dim b(4) As String, n As Integer, i As Integer, pr As Integer n = 7: h = "0.0000001": pr = 4 * (Len(h) - 2) + 16 b(0) = x0 For i = 1 To 4 x(1) = b(i - 1): x(2) = h: b(i) = SumarDec(x(), n) Next i x(1) = g(b(0), pr): x(2) = g(b(4), pr): sx = SumarDec(x(), n) x(1) = g(b(1), pr): x(2) = g(b(3), pr): x(1) = SumarDec(x(), n): x(2) = "-4" x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = g(b(2), pr): x(2) = "6": x(1) = MultiplicarDec(x(), n) x(2) = sx: sx = SumarDec(x(), n): x(1) = h: x(2) = "4" x(2) = PotenciasDec(x(), n): x(1) = sx g4 = DividirDec(x(), 16, n) End Function ‘================================================================= Public Function g6(ByVal x0 As String) As String Dim h As String, sx As String, x(2) As String Dim b(6) As String, n As Integer, i As Integer, pr As Integer n = 7: h = "0.00001": pr = 6 * (Len(h) - 2) + 16

Monografias.com
9 b(0) = x0 For i = 1 To 6 x(1) = b(i - 1): x(2) = h: b(i) = SumarDec(x(), n) Next i x(1) = g(b(0), pr): x(2) = g(b(6), pr): sx = SumarDec(x(), n) x(1) = g(b(1), pr): x(2) = g(b(5), pr): x(1) = SumarDec(x(), n): x(2) = "-6" x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = g(b(2), pr): x(2) = g(b(4), pr): x(1) = SumarDec(x(), n): x(2) = "15" x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = g(b(3), pr): x(2) = "-20": x(1) = MultiplicarDec(x(), n) x(2) = sx: sx = SumarDec(x(), n): x(1) = h: x(2) = "6" x(2) = PotenciasDec(x(), n): x(1) = sx g6 = DividirDec(x(), 16, n) End Function Para que el tiempo de ejecución sea menor, se recomienda que el número de las partes en que se divide el intervalo sea una potencia de 2, aunque podría ser también cualquier número par. Al efectuar el cálculo de la integral de la función (5) entre los límites a 0 y b 2 con las funciones MST2C, MST4C y MST6C, se obtienen los siguientes valores para la integral: Nr. Divisiones: 8 16 32 64 128 MST2C 1.1962 1.196288 1.1962880 1.19628801 1.196288013 MST4C 1.19628 1.19628801 1.196288013 1.196288013322 1.19628801332260 Nr. 8 16 32 64 Didivisiones MST6C 1.196288013 1.19628801332 1.196288013322 1.19628801332260 Finalmente, hallando las derivadas manualmente y utilizando el cálculo de las funciones elementales con precisión grande, para calcular el valor de la integral se pueden considerar también las funciones siguientes: Public Function MST2D(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim i As Integer, s As String, d As String, a1 As String, x(2) As String Dim s0 As String, s2 As String, p As Integer, n As Integer, j As Integer Dim sx As String, pr As Integer, nn(2) As String, sa As String, sb As String n = 7: pr = 24: nn(1) = Mid$(Str$(Abs(np)), 2) x(1) = nn(1): x(2) = "2": nn(2) = Multiplicar(x(), n) ' pr es la precisión en los cálculos con decimales '----- Cálculo de la integral For j = 1 To 2 s0 = "0": s2 = "0": s = "0" x(1) = bx: x(2) = ax: x(1) = Restar(x(), n): x(2) = nn(j) d = DividirDec(x(), 12, n): x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) p =Val( nn(j)) / 2 For i = 1 To p x(1) = s0: x(2) = h(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = h2(a1, pr): s2 = SumarDec(x(), n) x(1) = d: x(2) = "2": x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n)

Monografias.com
10 If j = 1 Then sa = s Else sb = s Next j MST2D = PrecisionString(sa, sb) End Function ‘ ==================================================================== Public Function MST4D(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim s0 As String, s2 As String, s4 As String, p As Integer, x(2) As String Dim i As Integer, s As String, d As String, a1 As String, pr As Integer Dim j As Integer, sa As String, sb As String, n As Integer, nn(2) As String ' pr es la precisión en los cálculos con decimales '----- Cálculo de la integral n = 7: pr = 24: nn(1) = Mid$(Str$(Abs(np)), 2) x(1) = nn(1): x(2) = "2": nn(2) = Multiplicar(x(), n) For j = 1 To 2 s0 = "0": s2 = "0": s4 = "0": s = "0" x(1) = bx: x(2) = ax: x(1) = RestarDec(x(), n): x(2) = nn(j) d = DividirDec(x(), pr, n): p = Val(nn(j)) / 2 x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) For i = 1 To p x(1) = s0: x(2) = h(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = h2(a1, pr): s2 = SumarDec(x(), n) x(1) = s4: x(2) = h4(a1, pr): s4 = SumarDec(x(), n) x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "60" x(1) = DividirDec(x(), pr, n): x(2) = s4: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n) If j = 1 Then sa = s Else sb = s Next j MST4D = PrecisionString(sa, sb) End Function ‘ ==================================================================== Public Function MST6D(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim s0 As String, s2 As String, s4 As String, s6 As String, x(2) As String, nn(2) As String Dim i As Integer, s As String, d As String, a1 As String, pr As Integer Dim j As Integer, sa As String, sb As String, n As Integer, p As Integer n = 7: pr =24 : nn(1) = Mid$(Str$(Abs(np)), 2) x(1) = nn(1): x(2) = "2": nn(2) = Multiplicar(x(), n) ' pr es la precisión en los cálculos con decimales '----- Cálculo de la integral For j = 1 To 2 s0 = "0": s2 = "0": s4 = "0": s6 = "0": s = "0" x(1) = bx: x(2) = ax: x(1) = RestarDec(x(), n): x(2) = nn(j) d = DividirDec(x(), pr, n): p = Val(nn(j)) / 2 x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) For i = 1 To p x(1) = s0: x(2) = h(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = h2(a1, pr): s2 = SumarDec(x(), n) x(1) = s4: x(2) = h4(a1, pr): s4 = SumarDec(x(), n) x(1) = s6: x(2) = h6(a1, pr): s6 = SumarDec(x(), n) x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "60" x(1) = DividirDec(x(), pr, n): x(2) = s4: x(1) = MultiplicarDec(x(), n): x(2) = s

Monografias.com
11 s = SumarDec(x(), n): x(1) = d: x(2) = "7": x(1) = PotenciasDec(x(), n): x(2) = "2520" x(1) = DividirDec(x(), pr, n): x(2) = s6: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n) If j = 1 Then sa = s Else sb = s Next j MST6D = PrecisionString(sa, sb) End Function ‘ ================================================= Public Function h(ByVal x0 As String, pr As Integer) As String Dim u As String, x(2) As String, n As Integer n=7 x(1) = x0: x(2) = x0: x(1) = MultiplicarDec(x(), n): x(2) = "-0.5" u = MultiplicarDec(x(), n) h = ExpP(u, pr) End Function ‘=================================================== Public Function h2(ByVal x0 As String, pr As Integer) As String Dim x(2) As String, u As String, v As String, n As Integer n = 7: x(1) = x0: x(2) = "2" x(1) = PotenciasDec(x(), n): x(2) = "1": u = RestarDec(x(), n) x(1) = x0: x(2) = x0: x(1) = MultiplicarDec(x(), n): x(2) = "-0.5" v = MultiplicarDec(x(), n): x(1) = u: x(2) = ExpP(v, 24) h2 = MultiplicarDec(x(), n) End Function ‘ ===================================================== Public Function h4(ByVal x0 As String, pr As Integer) As String Dim x(2) As String, u As String, v As String, n As Integer n = 7: x(1) = x0: x(2) = "4": u = PotenciasDec(x(), n) x(1) = x0: x(2) = "2": x(1) = PotenciasDec(x(), n): x(2) = "-6" x(1) = MultiplicarDec(x(), n): x(2) = "3": v = SumarDec(x(), n) x(1) = u: x(2) = v: u = SumarDec(x(), n) x(1) = x0: x(2) = x0: x(1) = MultiplicarDec(x(), n): x(2) = "-0.5" v = MultiplicarDec(x(), n): v = ExpP(v, 24) x(1) = u: x(2) = v h4 = MultiplicarDec(x(), n) End Function ‘ ================================================================ Public Function h6(ByVal x0 As String, pr As Integer) As String Dim x(2) As String, u As String, v As String, w As String, n As Integer n = 7: x(1) = x0: x(2) = "6": u = PotenciasDec(x(), n) x(1) = x0: x(2) = "4": x(1) = PotenciasDec(x(), n): x(2) = "-15" v = MultiplicarDec(x(), n): x(1) = x0: x(2) = "2": x(1) = PotenciasDec(x(), n): x(2) = "45" x(1) = MultiplicarDec(x(), n): x(2) = "-15": w = SumarDec(x(), n) x(1) = u: x(2) = v: x(1) = SumarDec(x(), n): x(2) = w: u = SumarDec(x(), n) x(1) = x0: x(2) = x0: x(1) = MultiplicarDec(x(), n): x(2) = "-0.5" v = MultiplicarDec(x(), n): x(1) = ExpP(v, 24): x(2) = u h6 = MultiplicarDec(x(), n) End Function Las tablas siguientes, dan una idea de las posibilidades de cálculo con las funciones MST2D, MST4D y MS&D. Función MST2D Nº de las divisiones 8 16 32 64 128 Valor de la integral 1.1962 1.196288 1.1962880 1.19628801 1.196288013

Monografias.com
8 (7) I 2 12 Función MST4D Función MST6D Nº de las divisiones 8 16 32 64 128 Nº de las divisiones 16 32 64 128 Valor de la integral 1.19628 1.19628801 1.196288013 1.196288013322 1.19628801332260 Valor de la integral 1.196288013 1.19628801332 1.1962880133226 1.1962880133226082 1.19628801332260820 Si en la función MST6D pr 24 y al intervalo 0,2 se divide en 1024 partes iguales, la integral definida de la función (5) sobre este intervalo es: I 1.19628801 3322608202 931 , donde hay 21 cifras después del punto decimal (imposible de obtener con los métodos convencionales, que trabajan en la aritmética de punto flotante). Hasta ahora, para evaluar la precisión del resultado no se ha utilizado la fórmula (4). La precisión se evaluó calculando el valor de la integral para dos divisiones del intervalo, donde la segunda división tenía el doble de puntos que la primera y reteniendo del primer valor de la integral la sección izquierda máxima que figura encaja enteramente en el segundo valor. Por ejemplo, si se calcula el valor de la integral (1) de la función (5) en el intervalo 0,2 (utilizando la función MST4C), dividiendo el intervalo en 8 y luego en 16 partes iguales, se obtienen los valores siguientes para el integral: I1 1.1962878898? 1.1962880114? Se observa que la sección izquierda máxima de I1 que se encuentra enteramente en I 2 , es 1.19628 I . Se podría proceder de otra manera también, calculando la misma integral solo para 8 divisiones y evaluando una cota superior del error absoluto del error del cálculo utilizando la fórmula (4) El programa siguiente calcula la integral anterior dividiendo el intervalo en 8 partes iguales y determina con la fórmula (4) la cota superior del error absoluto de los cálculos: Public Function MST4CC(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim s0 As String, s2 As String, s4 As String, p As Integer, x(2) As String Dim i As Integer, s As String, d As String, a1 As String, u As String Dim k As Integer, sa As String, sb As String, n As Integer, u As String Dim nps As String, cota As String, v As String, pr As Integer Dim dif0 As String, dif1 As String, dif2 As String ' pr precisión en los calculos con decimales '----- Cálculo de la integral

Monografias.com
13 n = 7: pr = 16: nps = Mid$(Str$(Abs(np)), 2) s0 = "0": s2 = "0": s4 = "0": s = "0" x(1) = bx: x(2) = ax: dif0 = RestarDec(x(), n): x(1) = dif0: x(2) = nps d = DividirDec(x(), pr, n): p = np / 2 x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) For i = 1 To p x(1) = s0: x(2) = g(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = g2(a1): s2 = SumarDec(x(), n) x(1) = s4: x(2) = g4(a1): s4 = SumarDec(x(), n) x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "60" x(1) = DividirDec(x(), pr, n): x(2) = s4: x(1) = MultiplicarDec(x(), n): x(2) = s sa = SumarDec(x(), n) 'Cota superior del valor absoluto de la 5ª derivada en el intervalo(ax,bx) x(1) = bx: x(2) = ax: x(1) = RestarDec(x(), n): x(2) = "16": dif1 = DividirDec(x(), 2, n) ' ¡En las extremidades del intervalo la derivada puede no existir! x(1) = ax: x(2) = dif1: u = SumarDec(x(), n) cota = g5(u) If Left$(cota, 1) = "-" Then cota = Mid$(cota, 2) For i = 1 To 14 x(1) = u: x(2) = dif1: u = SumarDec(x(), n) v = g5(u) If Left$(v, 1) = "-" Then v = Mid$(v, 2) x(1) = cota: x(2) = v: dif2 = RestarDec(x(), n) If Left$(dif2, 1) = "-" Then cota = v Next i 'Precisión de la integral x(1) = dif0: x(2) = "6": x(1) = PotenciasDec(x(), n): x(2) = cota x(1) = MultiplicarDec(x(), n): x(2) = Factorial(6, n): u = DividirDec(x(), 24, n) x(1) = np: x(2) = "6": v = PotenciasDec(x(), n): x(1) = u: x(2) = v: u = DividirDec(x(), 24, n) x(1) = sa: x(2) = u If Left$(sa, 1) <> "-" Then sb = SumarDec(x(), n) Else sb = RestarDec(x(), n) k=1 Do If Left$(sa, k) = Left$(sb, k) Then k=k+1 Else s = Left$(sa, k - 1) Exit Do End If Loop If s = "" Or Len(s) = 1 Then s = Int(Val(sa)) MST4CC = s End Function ‘========================================================= Public Function g5(ByVal x0 As String) As String Dim h As String, sx As String, x(2) As String Dim b(5) As String, n As Integer, i As Integer, pr As Integer n = 7: h = "0.0000001": pr = 5 * (Len(h) - 2) + 16 b(0) = x0 For i = 1 To 5 x(1) = b(i - 1): x(2) = h: b(i) = SumarDec(x(), n) Next i x(1) = g(b(5), pr): x(2) = g(b(0), pr): sx = RestarDec(x(), n) x(1) = g(b(1), pr): x(2) = g(b(4), pr): x(1) = RestarDec(x(), n): x(2) = "5" x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = g(b(3), pr): x(2) = g(b(2), pr): x(1) = RestarDec(x(), n): x(2) = "10"

Monografias.com
14 x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = h: x(2) = "5" ' x(2) = sx: sx = SumarDec(x(), n): x(2) = PotenciasDec(x(), n): x(1) = sx g5 = DividirDec(x(), 16, n) End Function Utilizando la función MST4CC se obtiene que I1 1.1962878898 ? R 0.0000014819561? Puesto que sumando a I1 el valor máximo de R las primeras 4 decimales de I1 no quedan afectadas, se puede considerar que el valor aproximado de la integral es I 1.1962 (Si I1 fuera negativo se debería restar de I1 el valor máximo de R y ver la parte no afectada de I1 ). Se observa que la segunda manera de trabajar conduce a un decimal exacto menos en el resultado, aunque el cálculo ha necesitado un poco menos de tiempo. Si la cota del valor absoluto de la 5ª derivada es inmejorable, la pérdida de un decimal exacto en el resultado se debe a que la estimación del error absoluto del cálculo por la fórmula (4) es aceptable pero probablemente mejorable. Tal como se ha escrito la función MST4CC, a continuación se presenta las funciones MST6CC y MST6DD: Public Function MST6CC(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim s0 As String, s2 As String, s4 As String, s6 As String, x(2) As String Dim i As Integer, s As String, d As String, a1 As String, p As Integer Dim j As Integer, sa As String, sb As String, n As Integer, k As Integer Dim nps As String, cota As String, u As String, v As String, pr As Integer Dim dif0 As String, dif1 As String, dif2 As String ' pr precisión en los calculos con decimales '----- Cálculo de la integral n = 7: pr = 24: nps = Mid$(Str$(Abs(np)), 2) s0 = "0": s2 = "0": s4 = "0": s6 = "0": s = "0" If Left$(nps, 1) = " " Then nps = Mid$(nps, 2) x(1) = bx: x(2) = ax: dif0 = RestarDec(x(), n): x(1) = dif0: x(2) = nps d = DividirDec(x(), pr, n): p = np / 2 x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) For i = 1 To p x(1) = s0: x(2) = g(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = g2(a1): s2 = SumarDec(x(), n) x(1) = s4: x(2) = g4(a1): s4 = SumarDec(x(), n) x(1) = s6: x(2) = g6(a1): s6 = SumarDec(x(), n) x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "60" x(1) = DividirDec(x(), pr, n): x(2) = s4: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "7": x(1) = PotenciasDec(x(), n): x(2) = "2520" x(1) = DividirDec(x(), pr, n): x(2) = s6: x(1) = MultiplicarDec(x(), n): x(2) = s sa = SumarDec(x(), n) 'Cota superior del valor absoluto de la 7ª derivada en el intervalo(ax,bx) x(1) = bx: x(2) = ax: x(1) = RestarDec(x(), n): x(2) = "16": dif1 = DividirDec(x(), 2, n) ' ¡En las extremidades del intervalo la derivada puede no existir! x(1) = ax: x(2) = dif1: u = SumarDec(x(), n) cota = g7(u) If Left$(cota, 1) = "-" Then cota = Mid$(cota, 2) For i = 1 To 14

Monografias.com
128 15 x(1) = u: x(2) = dif1: u = SumarDec(x(), n) v = g7(u) If Left$(v, 1) = "-" Then v = Mid$(v, 2) x(1) = cota: x(2) = v: dif2 = RestarDec(x(), n) If Left$(dif2, 1) = "-" Then cota = v Next i 'Precisión de la integral x(1) = dif0: x(2) = "8": x(1) = PotenciasDec(x(), n): x(2) = cota x(1) = MultiplicarDec(x(), n): x(2) = Factorial(8, n): u = DividirDec(x(), 24, n) x(1) = np: x(2) = "7": v = PotenciasDec(x(), n): x(1) = u: x(2) = v: u = DividirDec(x(), 24, n) x(1) = sa: x(2) = u If Left$(sa, 1) <> "-" Then sb = SumarDec(x(), n) Else sb = RestarDec(x(), n) k=1 Do If Left$(sa, k) = Left$(sb, k) Then k=k+1 Else s = Left$(sa, k - 1) Exit Do End If Loop If s = "" Or Len(s) = 1 Then s = Int(Val(sa)) MST6CC = s End Function ‘===================================================== Public Function g7(ByVal x0 As String) As String Dim h As String, sx As String, x(2) As String Dim b(7) As String, n As Integer, i As Integer, pr As Integer n = 7: h = "0.0000001": pr = 5 * (Len(h) - 2) + 16 b(0) = x0 For i = 1 To 7 x(1) = b(i - 1): x(2) = h: b(i) = SumarDec(x(), n) Next i x(1) = g(b(7), pr): x(2) = g(b(0), pr): sx = RestarDec(x(), n) x(1) = g(b(1), pr): x(2) = g(b(6), pr): x(1) = RestarDec(x(), n): x(2) = "7" x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = g(b(5), pr): x(2) = g(b(2), pr): x(1) = RestarDec(x(), n): x(2) = "21" x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = g(b(3), pr): x(2) = g(b(4), pr): x(1) = RestarDec(x(), n): x(2) = "35" x(1) = MultiplicarDec(x(), n): x(2) = sx: sx = SumarDec(x(), n) x(1) = h: x(2) = "7" ' x(2) = sx: sx = SumarDec(x(), n): x(2) = PotenciasDec(x(), n): x(1) = sx g7 = DividirDec(x(), 16, n) End Function Nº de las divisiones: MST4CC 1.1962880133226 MST6CC 1.19628801332260 Public Function MST6DD(ByVal ax As String, ByVal bx As String, ByVal np As Integer) As String Dim s0 As String, s2 As String, s4 As String, s6 As String, x(2) As String Dim i As Integer, s As String, d As String, a1 As String, pr As Integer Dim sa As String, sb As String, n As Integer, p As Integer, nps As String Dim dif0 As String, dif1 As String, dif2 As String Dim u As String, v As String, cota As String, k As Integer n = 7: pr = 24: nps = Mid$(Str$(Abs(np)), 2) If Left$(nps, 1) = " " Then nps = Mid$(nps, 2) ' pr es la precisión en los calculos con decimales '----- Cálculo de la integral s0 = "0": s2 = "0": s4 = "0": s6 = "0": s = "0" x(1) = bx: x(2) = ax: dif0 = RestarDec(x(), n): x(1) = dif0: x(2) = nps

Monografias.com
16 d = DividirDec(x(), pr, n): p = np / 2 x(1) = ax: x(2) = d: a1 = SumarDec(x(), n) For i = 1 To p x(1) = s0: x(2) = h(a1, pr): s0 = SumarDec(x(), n) x(1) = s2: x(2) = h2(a1, pr): s2 = SumarDec(x(), n) x(1) = s4: x(2) = h4(a1, pr): s4 = SumarDec(x(), n) x(1) = s6: x(2) = h6(a1, pr): s6 = SumarDec(x(), n) x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = a1: a1 = SumarDec(x(), n) Next i x(1) = "2": x(2) = d: x(1) = MultiplicarDec(x(), n): x(2) = s0 s = MultiplicarDec(x(), n) x(1) = d: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "3" x(1) = DividirDec(x(), pr, n): x(2) = s2: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "60" x(1) = DividirDec(x(), pr, n): x(2) = s4: x(1) = MultiplicarDec(x(), n): x(2) = s s = SumarDec(x(), n): x(1) = d: x(2) = "7": x(1) = PotenciasDec(x(), n): x(2) = "2520" x(1) = DividirDec(x(), pr, n): x(2) = s6: x(1) = MultiplicarDec(x(), n): x(2) = s sa = SumarDec(x(), n) 'Cota superior del valor absoluto de la 7ª derivada en el intervalo(ax,bx) x(1) = bx: x(2) = ax: x(1) = RestarDec(x(), n): x(2) = "16": dif1 = DividirDec(x(), 2, n) ' ¡En las extremidades del intervalo la derivada puede no existir! x(1) = ax: x(2) = dif1: u = SumarDec(x(), n) cota = h7(u, 36) If Left$(cota, 1) = "-" Then cota = Mid$(cota, 2) For i = 1 To 14 x(1) = u: x(2) = dif1: u = SumarDec(x(), n) v = h7(u, 24) If Left$(v, 1) = "-" Then v = Mid$(v, 2) x(1) = cota: x(2) = v: dif2 = RestarDec(x(), n) If Left$(dif2, 1) = "-" Then cota = v Next i 'Precisión de la integral x(1) = dif0: x(2) = "8": x(1) = PotenciasDec(x(), n): x(2) = cota x(1) = MultiplicarDec(x(), n): x(2) = Factorial(8, n): u = DividirDec(x(), 24, n) x(1) = np: x(2) = "7": v = PotenciasDec(x(), n): x(1) = u: x(2) = v: u = DividirDec(x(), 24, n) x(1) = sa: x(2) = u If Left$(sa, 1) <> "-" Then sb = SumarDec(x(), n) Else sb = RestarDec(x(), n) k=1 Do If Left$(sa, k) = Left$(sb, k) Then k=k+1 Else s = Left$(sa, k - 1) Exit Do End If Loop If s = "" Or Len(s) = 1 Then s = Int(Val(sa)) MST6DD = PrecisionString(sa, sb) End Function ‘============================================================ Public Function h7(ByVal x0 As String, pr As Integer) As String Dim x(2) As String, u As String, v As String, n As Integer n = 7: x(1) = x0: x(2) = "7": u = PotenciasDec(x(), n) If Left$(u, 1) = "-" Then u = Mid$(u, 2) Else u = u + "-" x(1) = x0: x(2) = "5": x(1) = PotenciasDec(x(), n): x(2) = "21" v = MultiplicarDec(x(), n): x(1) = x0: x(2) = "3": x(1) = PotenciasDec(x(), n): x(2) = "-108" x(1) = MultiplicarDec(x(), n): x(2) = v: v = SumarDec(x(), n): x(1) = u: x(2) = v: u = SumarDec(x(), n) x(1) = x0: x(2) = "111": x(1) = MultiplicarDec(x(), n): x(2) = u: u = SumarDec(x(), n) x(1) = x0: x(2) = x0: x(1) = MultiplicarDec(x(), n): x(2) = "-0.5" v = MultiplicarDec(x(), n): x(1) = ExpP(v, 24): x(2) = u h7 = MultiplicarDec(x(), n) End Function

Monografias.com
17 Nº de las divisiones: 128 256 512 1024 MST6DD 1.196288013322608 1.19628801332260820 1.1962880133226082029 1.196288013322608202931 Las funciones MST4CC y MST6CC son lentas, sobre todo si se pretende más precisión (el intervalo se divide en muchas partes). En los superordenadores del futuro seguramente van a parecer más rápidas. La función MST6DD es más rápida y permite obtener resultados precisión grande, sin embargo para utilizarla hay que calcular las derivadas hasta el orden 7 (de manera manual)., que a veces no cuesta tanto. Advertencia: Para utilizar las funciones MST2C, MST4C, MST6C, Mst6CC, MST2D, MST4D, MST6D y MST6DD es necesario cargar en un módulo las funciones para operar con enteros y decimales largos y las funciones elementales de precisión grande [1]-[3] Bibliografía: [1] A. Peter Santha, Cálculos con números enteros largos en ordenadores, Monografías.com [2] A. Peter Santha, Cálculos con números decimales largos en ordenadores, Monografías.com [3] A. Peter Santha, Cálculo de los valores de las funciones elementales con precisión grande, Monografías.com [4] A. Peter Santha, Cálculo aproximado de las derivadas y derivadas parciales de orden superior, Monografías.com [5] B. DÉMIDOVITCH et I. MARON, ÉLÉMENTS DE CALCULE NUMÉRIQUE, ÉDITIONS MIR, MOCOU, 1973

Comentarios


Trabajos relacionados

  • Distribución Normal

    Distribución Normal. Función de densidad. La distribución binomial. Esta distribución es frecuentemente utilizada en l...

  • Estructura y funcionamiento del Programa Raíces

    Carlos alberto PérezEl programa esta compuesto por la función principal raices y 9 subfunciones: Raices (principal; Cuad...

  • El poder del Solver

    Ejemplo de cómo usar "SOLVER". En estos tiempos donde se habla de la tecnología, información, sociedad del conocimient...

Ver mas trabajos de Matematicas

 
 

Nota al lector: es posible que esta página no contenga todos los componentes del trabajo original (pies de página, avanzadas formulas matemáticas, esquemas o tablas complejas, etc.). Recuerde que para ver el trabajo en su versión original completa, puede descargarlo desde el menú superior.


Todos los documentos disponibles en este sitio expresan los puntos de vista de sus respectivos autores y no de Monografias.com. El objetivo de Monografias.com es poner el conocimiento a disposición de toda su comunidad. Queda bajo la responsabilidad de cada lector el eventual uso que se le de a esta información. Asimismo, es obligatoria la cita del autor del contenido y de Monografias.com como fuentes de información.

Iniciar sesión

Ingrese el e-mail y contraseña con el que está registrado en Monografias.com

   
 

Regístrese gratis

¿Olvidó su contraseña?

Ayuda