Home My Page Projects MPFI
Summary Activity Forums Tracker Lists Tasks Docs News SCM Files

[#18277] Lack of robustness or optimisation of the mpfi_abs function ?

Date:
2014-11-10 23:08
Priority:
3
State:
Open
Submitted by:
Fabrice Larribe (teyssieuman)
Assigned to:
Nobody (None)
Category:
none
Group:
none
Summary:
Lack of robustness or optimisation of the mpfi_abs function ?

Detailed description
I tried the "mpfi_abs" function on a malformed interval : [1e0, -1e0]

The result is non coherent : [ 0.0000000000, -1.0000000000]

This result can be normal if the incoherent input is non admissible for this function.
In this case, an optimization is possible.

The "mpfi_abs" function call the "MPFI_IS_NONNEG" macro. this macro is defined as follow:

#define MPFI_IS_NONNEG(x) ((mpfr_sgn((&(x->left)))>=0) && (mpfr_sgn((&(x->right)))>=0))

If the "malformed intervals" are not supported, so a macro as follow can be used :

#define MPFI_IS_NONNEG(x) ((mpfr_sgn((&(x->left)))>=0)

Such a macro is less "time consuming".

I join a simple example that demonstrate the "mpfi_abs" behaviors with the "[1e0, -1e0]" input.

No Comments Have Been Posted

Attachments:
Size Name Date By Download
575 bytesmain.c2014-11-10 23:08teyssieumanmain.c
Field Old Value Date By
File Added4141: main.c2014-11-10 23:08teyssieuman