Lines Matching +full:ulp +full:- +full:allow
2 * ULP error checking tool for math functions.
4 * Copyright (c) 2019-2023, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
94 if (r - m <= -n) in randn()
155 that produce dense sampling without collisions and allow in next1()
157 uint64_t r = g->start + g->off; in next1()
158 g->off += g->step + randn (g->step / 2); in next1()
159 if (g->off > g->len) in next1()
160 g->off -= g->len; /* hack. */ in next1()
168 uint64_t r = g->start + randn (g->len); in next2()
169 *x2 = g->start2 + randn (g->len2); in next2()
216 with an in-range value and then with a special case value. */
223 /* First element of fv and dv may be changed by -c argument. */
224 static float fv[2] = {1.0f, -INFINITY};
225 static double dv[2] = {1.0, -INFINITY};
238 base[n-1] = (float) fv[secondcall]; in svargf()
246 base[n-1] = dv[secondcall]; in svargd()
357 return e - 0x7f - 23; in ulpscale_f()
365 return e - 0x3ff - 52; in ulpscale_d()
370 return f->fun.f1 (a.x); in call_f1()
375 return f->fun.f2 (a.x, a.x2); in call_f2()
381 return f->fun.d1 (a.x); in call_d1()
386 return f->fun.d2 (a.x, a.x2); in call_d2()
391 return f->fun_long.f1 (a.x); in call_long_f1()
396 return f->fun_long.f2 (a.x, a.x2); in call_long_f2()
401 return f->fun_long.d1 (a.x); in call_long_d1()
406 return f->fun_long.d2 (a.x, a.x2); in call_long_d2()
411 printf ("%s(%a)", f->name, a.x); in printcall_f1()
416 printf ("%s(%a, %a)", f->name, a.x, a.x2); in printcall_f2()
421 printf ("%s(%a)", f->name, a.x); in printcall_d1()
426 printf ("%s(%a, %a)", f->name, a.x, a.x2); in printcall_d2()
431 printf ("%s in [%a;%a]", f->name, asfloat (gen->start), in printgen_f1()
432 asfloat (gen->start + gen->len)); in printgen_f1()
437 printf ("%s in [%a;%a] x [%a;%a]", f->name, asfloat (gen->start), in printgen_f2()
438 asfloat (gen->start + gen->len), asfloat (gen->start2), in printgen_f2()
439 asfloat (gen->start2 + gen->len2)); in printgen_f2()
444 printf ("%s in [%a;%a]", f->name, asdouble (gen->start), in printgen_d1()
445 asdouble (gen->start + gen->len)); in printgen_d1()
450 printf ("%s in [%a;%a] x [%a;%a]", f->name, asdouble (gen->start), in printgen_d2()
451 asdouble (gen->start + gen->len), asdouble (gen->start2), in printgen_d2()
452 asdouble (gen->start2 + gen->len2)); in printgen_d2()
495 return -1; in rmap()
502 #define emin_f -148
503 #define emin_d -1073
511 return f->fun_mpfr.f1 (y, x, r); in call_mpfr_f1()
520 return f->fun_mpfr.f2 (y, x, x2, r); in call_mpfr_f2()
527 return f->fun_mpfr.d1 (y, x, r); in call_mpfr_d1()
536 return f->fun_mpfr.d2 (y, x, x2, r); in call_mpfr_d2()
550 #define min_normal_f 0x1p-126f
562 #define min_normal_d 0x1p-1022
567 #include "ulp.h"
570 #include "ulp.h"
577 #include "ulp.h"
580 #include "ulp.h"
587 puts ("./ulp [-q] [-m] [-f] [-r {n|u|d|z}] [-l soft-ulplimit] [-e ulplimit] func " in usage()
590 puts ("-q: quiet."); in usage()
591 puts ("-m: use mpfr even if faster method is available."); in usage()
592 puts ("-f: disable fenv exceptions testing."); in usage()
594 puts ("-c: neutral 'control value' to test behaviour when one lane can affect another. \n" in usage()
595 " This should be different from tested input in other lanes, and non-special \n" in usage()
598 puts ("-z: ignore sign of 0."); in usage()
600 for (const struct fun *f = fun; f->name; f++) in usage()
601 printf ("\t%s\n", f->name); in usage()
609 if (f->arity == 1 && f->singleprec) in cmp()
611 else if (f->arity == 2 && f->singleprec) in cmp()
613 else if (f->arity == 1 && !f->singleprec) in cmp()
615 else if (f->arity == 2 && !f->singleprec) in cmp()
631 else if (s[0] == '-') in getnum()
636 /* 0xXXXX is treated as bit representation, '-' flips the sign bit. */ in getnum()
649 /* Otherwise assume it's a floating-point literal. */ in getnum()
657 int singleprec = f->singleprec; in parsegen()
658 int arity = f->arity; in parsegen()
666 argc -= 2; in parsegen()
674 argc -= 3; in parsegen()
688 g->start = a; in parsegen()
689 g->len = b - a; in parsegen()
690 if (n - 1 > b - a) in parsegen()
691 n = b - a + 1; in parsegen()
692 g->off = 0; in parsegen()
693 g->step = n ? (g->len + 1) / n : 1; in parsegen()
694 g->start2 = g->len2 = 0; in parsegen()
695 g->cnt = n; in parsegen()
699 g->start = a; in parsegen()
700 g->len = b - a; in parsegen()
701 g->off = g->step = 0; in parsegen()
702 g->start2 = a2; in parsegen()
703 g->len2 = b2 - a2; in parsegen()
704 g->cnt = n; in parsegen()
725 argc--; in main()
729 if (argv[0][0] != '-') in main()
734 argc--; in main()
744 argc--; in main()
760 argc--; in main()
772 argc--; in main()
799 for (f = fun; f->name; f++) in main()
800 if (strcmp (argv[0], f->name) == 0) in main()
802 if (!f->name) in main()
816 if (!f->singleprec && LDBL_MANT_DIG == DBL_MANT_DIG) in main()
823 argc--; in main()