<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>123624</bug_id>
          
          <creation_ts>2013-11-01 10:47:18 -0700</creation_ts>
          <short_desc>Precision errors in Math.cbrt() on GTK, EFL</short_desc>
          <delta_ts>2013-11-04 10:01:27 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zan Dobersek">zan</reporter>
          <assigned_to name="Zan Dobersek">zan</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>darin</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>msaboff</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>945944</commentid>
    <comment_count>0</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-11-01 10:47:18 -0700</bug_when>
    <thetext>Math.cbrt(), introduced in r158401, is returning unexpected values in the js/math.html layout test (and the related stress tests) that are indicating precision errors. This only occurs on GTK and EFL.
http://trac.webkit.org/changeset/158401

The precision error originates in the underlying cbrt() call in JSC::mathProtoFuncCbrt. pow() works as expected, FWIW.

Diff:
--- /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/js/math-expected.txt
+++ /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/js/math-actual.txt
@@ -184,8 +184,8 @@
 PASS Math.cbrt(NaN) is NaN
 PASS Math.cbrt(0) is 0
 PASS Math.cbrt(-0) is -0
-PASS Math.cbrt(27) is 3
-PASS Math.cbrt(-27) is -3
+FAIL Math.cbrt(27) should be 3. Was 3.0000000000000004.
+FAIL Math.cbrt(-27) should be -3. Was -3.0000000000000004.
 PASS Math.cbrt(Infinity) is Infinity
 PASS Math.cbrt(-Infinity) is -Infinity
 PASS Math.cosh(NaN) is NaN</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>946057</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-11-01 15:28:54 -0700</bug_when>
    <thetext>Try changing the test to +/-8 -&gt; +/-2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>946217</commentid>
    <comment_count>2</comment_count>
      <attachid>215808</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-11-02 08:20:07 -0700</bug_when>
    <thetext>Created attachment 215808
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>946489</commentid>
    <comment_count>3</comment_count>
      <attachid>215808</attachid>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-11-03 13:56:03 -0800</bug_when>
    <thetext>Comment on attachment 215808
Patch

LGTM</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>946494</commentid>
    <comment_count>4</comment_count>
      <attachid>215808</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-11-03 14:24:57 -0800</bug_when>
    <thetext>Comment on attachment 215808
Patch

Clearing flags on attachment: 215808

Committed r158545: &lt;http://trac.webkit.org/changeset/158545&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>946496</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-11-03 14:25:00 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>946518</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-11-03 17:02:06 -0800</bug_when>
    <thetext>This patch just stops testing for this bug, it doesn’t fix the bug. Do we want to fix the bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>946711</commentid>
    <comment_count>7</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-11-04 10:01:27 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; This patch just stops testing for this bug, it doesn’t fix the bug. Do we want to fix the bug?

The bug is lack of precision in the linux/gtk lib math, it can&apos;t be fixed in JSC short of us reimplementing cbrt entirely</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>215808</attachid>
            <date>2013-11-02 08:20:07 -0700</date>
            <delta_ts>2013-11-03 14:24:57 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-123624-20131102082007.patch</filename>
            <type>text/plain</type>
            <size>1934</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">SW5kZXg6IExheW91dFRlc3RzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBMYXlvdXRUZXN0cy9D
aGFuZ2VMb2cJKHJldmlzaW9uIDE1ODQ4NykKKysrIExheW91dFRlc3RzL0NoYW5nZUxvZwkod29y
a2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBACisyMDEzLTExLTAyICBaYW4gRG9iZXJzZWsgIDx6
ZG9iZXJzZWtAaWdhbGlhLmNvbT4KKworICAgICAgICBQcmVjaXNpb24gZXJyb3JzIGluIE1hdGgu
Y2JydCgpIG9uIEdUSywgRUZMCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3df
YnVnLmNn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XMgLTMKK1BBU1MgTWF0aC5jYnJ0KDgpIGlzIDIKK1BBU1MgTWF0aC5j
YnJ0KC04KSBpcyAtMgogUEFTUyBNYXRoLmNicnQoSW5maW5pdHkpIGlzIEluZmluaXR5CiBQQVNT
IE1hdGguY2JydCgtSW5maW5pdHkpIGlzIC1JbmZpbml0eQogUEFTUyBNYXRoLmNvc2goTmFOKSBp
cyBOYU4KSW5kZXg6IExheW91dFRlc3RzL2pzL3NjcmlwdC10ZXN0cy9tYXRoLmpzCj09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT0KLS0tIExheW91dFRlc3RzL2pzL3NjcmlwdC10ZXN0cy9tYXRoLmpzCShyZXZpc2lvbiAxNTg0
ODUpCisrKyBMYXlvdXRUZXN0cy9qcy9zY3JpcHQtdGVzdHMvbWF0aC5qcwkod29ya2luZyBjb3B5
KQpAQCAtMjYxLDggKzI2MSw4IEBAIHNob3VsZEJlKCJNYXRoLmF0YW5oKC1JbmZpbml0eSkiLCAi
TmFOIikKIHNob3VsZEJlKCJNYXRoLmNicnQoTmFOKSIsICJOYU4iKTsKIHNob3VsZEJlKCJNYXRo
LmNicnQoMCkiLCAiMCIpOwogc2hvdWxkQmUoIk1hdGguY2JydCgtMCkiLCAiLTAiKTsKLXNob3Vs
ZEJlKCJNYXRoLmNicnQoMjcpIiwgIjMiKTsKLXNob3VsZEJlKCJNYXRoLmNicnQoLTI3KSIsICIt
MyIpOworc2hvdWxkQmUoIk1hdGguY2JydCg4KSIsICIyIik7CitzaG91bGRCZSgiTWF0aC5jYnJ0
KC04KSIsICItMiIpOwogc2hvdWxkQmUoIk1hdGguY2JydChJbmZpbml0eSkiLCAiSW5maW5pdHki
KTsKIHNob3VsZEJlKCJNYXRoLmNicnQoLUluZmluaXR5KSIsICItSW5maW5pdHkiKTsKIAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>