Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 206972

Summary: kde-base/kmplot-3.5.7: Calculate Integral gives incorrect answers.
Product: Gentoo Linux Reporter: Kim Nilsson <nilekurt>
Component: [OLD] KDEAssignee: Gentoo KDE team <kde>
Status: VERIFIED INVALID    
Severity: normal    
Priority: High    
Version: 2007.0   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info output

Description Kim Nilsson 2008-01-22 01:30:17 UTC
I tried to calculate a few integrals using KmPlot, but it returned erroneous answers which never exceeded 1.

Reproducible: Always

Steps to Reproduce:
1.Run KmPlot
2.Plot any function (Example: y=sin x )
3.Select "Calculate Integral" from the "Tools" menu
4.Enter any valid range and select the function (Example: Between x=0 and x=pi)
5.Calculate
Actual Results:  
KmPlot returns an incorrect answer which is always less than 1. (Example: 0)

Expected Results:  
It should return valid answers. (Example: 1)

Using KDE 3.5.7
Comment 1 Kim Nilsson 2008-01-22 01:33:55 UTC
Created attachment 141546 [details]
emerge --info output
Comment 2 Kim Nilsson 2008-01-22 01:38:23 UTC
emerge --info
Portage 2.1.3.19 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo-r3 i686)
=================================================================
System uname: 2.6.23-gentoo-r3 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Timestamp of tree: Mon, 21 Jan 2008 16:59:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.10-r5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=k8 -pipe -ffast-math"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O3 -march=k8 -pipe -ffast-math"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/ ftp://trumpetti.atm.tut.fi/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ "
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aac acl aim alsa arts berkdb bitmap-fonts bluetooth bzip cd cdr cli cracklib crypt cups divx dri dvd dvdr exif ffmpeg flac fortran ftp gdbm gif gpm gtk hal iconv ipv6 isdnlog jabber jack java jingle jpeg jpeg2k kde midi mp3 mpeg mplayer msn mudflap ncurses nls nptl nptlonly openal opengl openmp pam pcre perl pppd python qt4 readline reflection session socks5 speex spl ssl tcpd truetype-fonts type1-fonts unicode usb vcd vnc vorbis win32codecs x264 x86 xorg xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fglrx radeon vesafb"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 3 Ingmar Vanhassel (RETIRED) gentoo-dev 2008-01-22 01:43:34 UTC
(In reply to comment #2)
> CFLAGS="-O3 -march=k8 -pipe -ffast-math"
> CXXFLAGS="-O3 -march=k8 -pipe -ffast-math"

It breaks because you use -ffast-math.
To quote `man gcc`:
	This option should never be turned on by any -O option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions.

http://www.gentoo.org/doc/en/gcc-optimization.xml for more info.