searchgal searches for a preimage of a function such that the rounding the image yields an error smaller than a constant

Library name:

sollya_obj_t sollya_lib_searchgal(sollya_obj_t, sollya_obj_t, sollya_obj_t,                                   sollya_obj_t, sollya_obj_t, sollya_obj_t)


searchgal(function, start, preimage precision, steps, format, error bound) : (function, constant, integer, integer, HP|halfprecision|SG|single|D|double|DE|doubleextended|DD|doubledouble|QD|quad|TD|tripledouble, constant) -> list searchgal(list of functions, start, preimage precision, steps, list of format, list of error bounds) : (list, constant, integer, integer, list, list) -> list



Example 1:

   > searchgal(log(x),2,53,15,DD,1b-112);
   [| |]
   > searchgal(log(x),2,53,18,DD,1b-112);

Example 2:

   > f = exp(x);
   > s = searchgal(f,2,53,18,DD,1b-112);
   > if (s != [||]) then {
        v = s[0];
        print("The rounding error is 2^(",evaluate(log2(abs(DD(f)/f - 1)),v),")");
     } else print("No value found");
   The rounding error is 2^( -112.106878438809380148206984258358542322113874177832 )

Example 3:

   > searchgal([|sin(x),cos(x)|],1,53,15,[|D,D|],[|1b-62,1b-60|]);
See also: round, double, doubledouble, tripledouble, evaluate, worstcase
Go back to the list of commands