This bugzilla service is closed. All entries have been migrated to

Bug 1777

Summary: Make scalar and packet paths consistent
Product: Eigen Reporter: Gael Guennebaud <gael.guennebaud>
Component: Core - vectorizationAssignee: Nobody <eigen.nobody>
Status: DECISIONNEEDED ---    
Severity: Accuracy Problem CC: chtz, gael.guennebaud, jacob.benoit.1, markos, rmlarsen
Priority: Normal    
Version: 3.4 (development)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 814    
Description Flags
Patch to make the logistic function scalar-SIMD consistent none

Description Gael Guennebaud 2019-11-14 14:29:55 UTC
Currently many functions return slightly different results for coefficients evaluated using a SIMD path or a scalar path. This includes exp, log, logistic_function, etc.

Since the SIMD implementation of those functions can also be called on scalar inputs, we could easily solve this inconsistency by plugging the respective functor call to the generic SIMD path.

Shall we do that unconditionally or only if vectorization is enabled?
Comment 1 Gael Guennebaud 2019-11-14 15:08:39 UTC
Created attachment 960 [details]
Patch to make the logistic function scalar-SIMD consistent

Here is a first patch for the logistic/sigmoid function.

See also:

Please comment!
Comment 2 Christoph Hertzberg 2019-11-14 15:23:49 UTC
I agree, we should always call the same implementation. Having (even slightly) different results for the same input is not good.

For odd-sized inputs we should actually think about loading/storing partial packets (cf. Bug 692 comment 15), instead of doing a scalar loop at the end.

In Bug 1687 I suggested something like EIGEN_USE_SIMD_MATH_FUNCTIONS (but dropping EIGEN_FAST_MATH).
Comment 3 Nobody 2019-12-04 18:55:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: