# Worksheet to execute the examples in Gao, Kaltofen, May, Yang, & Zhi: # # 'Approximate Factorization of Multivariate polynomials via # differential Equations' > # Factorization routines: > read("multifac_1.2.mpl"): > # rand_path:="debug_exs\/": # for debugging the worksheet > rand_path:="examples\/": # examples in the paper > infolevel[multifac]:=2; infolevel[multifac] := 2 # A note about backward_error(F, G, [vars]): # We compute c so that ||F-c*G||_2 is as small as possible. The output # is ||F - c*G||_2 / ||F||_2. # # Example 16 has been moved to it's own worksheet. # Examples 10, 11 & 12: One polynomial (12, 7, 5) with perturbations of # different orders (-5 and -1) added: # Example 10: Three Factors (12, 7, 5), Large Noise -5, very sparse # noise: 5% > read(cat(rand_path,"exF10")): > F10 := expand(evalf(cleanF10 + noiseF10)): > norm(evalf(noiseF10),2) / norm(F10,2); > ceil(log10(%)); -5 0.9999995252 10 -5 > t10:=time(): > facF10:=appfac(F10,[x,y]): > t10:=time()-t10; ` the biggest gap, the last r-th singular values and the number of factors `, 658.3729016, .8558217297e-6, 3 ` The time for computing the number of factors*****`, 57.864 `The time for the entire factorization******`, 1092.101 t10 := 1092.141 > nops(facF10); 3 > berror10:=backward_error(F10, convert(facF10, `*`), [x,y]); > ceil(log10(%)); c = -1064.869729 berror10 := 0.0001564296376 -3 > save facF10, t10, berror10, cat(rand_path,"exF10-factors"); # Example 11: Three Factors (12, 7, 5), Large Noise -5 > read(cat(rand_path,"exF11")): > F11 := expand(evalf(cleanF11 + noiseF11)): > norm(evalf(noiseF11),2) / norm(F11,2); > ceil(log10(%)); 0.00001021859647 -4 > t11:=time(): > facF11:=appfac(F11,[x,y]): > t11:=time()-t11; ` the biggest gap, the last r-th singular values and the number of factors `, 833.5367031, .6758979173e-6, 3 ` The time for computing the number of factors*****`, 50.202 `The time for the entire factorization******`, 1659.746 t11 := 1659.786 > nops(facF11); 3 > berror11:=backward_error(F11, convert(facF11, `*`), [x,y]); > ceil(log10(%)); c = 3400.278174 berror11 := 0.0002870445337 -3 > save facF11, t11, berror11, cat(rand_path,"exF11-factors"); # Example 12: Three Factors (12, 7, 5), Larger Noise -3 > #read("exF12"): > F12 := expand(evalf(cleanF11 + 10.^2*noiseF11)): > norm(evalf(10.^2.*noiseF11),2) / norm(F12,2); > ceil(log10(%)); 0.001021825208 -2 > t12:=time(): > facF12:=appfac(F12,[x,y]): > t12:=time()-t12; ` the biggest gap, the last r-th singular values and the number of factors `, 8.340144257, .6756157841e-4, 3 ` The time for computing the number of factors*****`, 51.323 `The time for the entire factorization******`, 3163.960 t12 := 3164.010 > nops(facF12); 3 > berror12:=backward_error(F12, convert(facF12, `*`), [x,y]); > ceil(log10(%)); c = 838.1890412 berror12 := 0.05478797560 -1 > save facF12, t12, berror12, cat(rand_path,"exF12-factors"); > # #