Name:

remez computes the minimax of a function on an interval.

Library names:

sollya_obj_t sollya_lib_remez(sollya_obj_t, sollya_obj_t, sollya_obj_t, ...) sollya_obj_t sollya_lib_v_remez(sollya_obj_t, sollya_obj_t, sollya_obj_t,                                 va_list)

Usage:

remez(f, n, range, w, quality, bounds) : (function, integer, range, function, constant, range) -> function remez(f, L, range, w, quality, bounds) : (function, list, range, function, constant, range) -> function

Parameters:

Description:

Example 1:

   > p = remez(exp(x),5,[0;1]);
   > degree(p);
   5
   > dirtyinfnorm(p-exp(x),[0;1]);
   1.1295698151096148707171193829266077607222634589363e-6

Example 2:

   > p = remez(1,[|0,2,4,6,8|],[0,Pi/4],1/cos(x));
   > canonical=on!;
   > p;
   0.99999999994393732180959690352543887130348096061124 + -0.49999999571556857768772053063721544670949467222259 * x^2 + 4.1666613233473633009941059480570275870113220089059e-2 * x^4 + -1.3886529147145693651355523880319714051047635695061e-3 * x^6 + 2.4372679177224179934800328511009205218114284220126e-5 * x^8

Example 3:

   > p1 = remez(exp(x),5,[0;1],default,1e-5);
   > p2 = remez(exp(x),5,[0;1],default,1e-10);
   > p3 = remez(exp(x),5,[0;1],default,1e-15);
   > dirtyinfnorm(p1-exp(x),[0;1]);
   1.1295698151096148707171193829266077607222634589363e-6
   > dirtyinfnorm(p2-exp(x),[0;1]);
   1.12956980227478675612619255125474525171079325793124e-6
   > dirtyinfnorm(p3-exp(x),[0;1]);
   1.12956980227478675612619255125474525171079325793124e-6

Example 4:

   > L = [|exp(x), sin(x), cos(x)-1, sin(x^3)|];
   > g = (2^x-1)/x;
   > p1 = remez(g, L, [-1/16;1/16]);
   > p2 = remez(g, 3, [-1/16;1/16]);
   > dirtyinfnorm(p1 - g, [-1/16;1/16]);
   9.8841323829271038137685646777951687620288462194746e-8
   > dirtyinfnorm(p2 - g, [-1/16;1/16]);
   2.54337800593461418356437401152248866818783932027105e-9

Example 5:

   > f = sin(x);
   > I = [-3b-5;-1b-1074];
   > time(popt = remez(1, [|1, 3, 4, 5, 7, 8, 9|], I, 1/f));
   0.116157125999999999999999999999999999997386771862303
   > time(p1 = remez(1, [|1, 3, 4, 5, 7, 8, 9|], I, 1/f, default, [0, 1b-73]));
   8.6851247000000000000000000000000000000254830624298e-2
   > time(p2 = remez(1, [|1, 3, 4, 5, 7, 8, 9|], I, 1/f, default, [3b-72, +@Inf@]));
   9.6260799999999999999999999999999999996109922438892e-2
   > dirtyinfnorm(popt/f-1, I);
   2.06750931454112835098093903810531156576504665659064e-22
   > dirtyinfnorm(p1/f-1, I);
   2.49711266837493110470637913808914046704452778960875e-22
   > dirtyinfnorm(p2/f-1, I);
   5.4567247553615435246376977231253834265248756996947e-22
   > 1b-73;
   1.05879118406787542383540312584955245256423950195312e-22
   > 3b-72;
   6.3527471044072525430124187550973147153854370117187e-22
See also: dirtyinfnorm, infnorm, fpminimax, guessdegree, taylorform, taylor
Go back to the list of commands