1
0
mirror of https://github.com/golang/go synced 2024-11-18 12:04:57 -07:00
The Go programming language
Go to file
Martin Möhrmann 8c6643846e math: speed up and improve accuracy of Pow10
Removes init function from the math package.

Allows stripping of arrays with pre-computed values
used for Pow10 from binaries if Pow10 is not used.
cmd/go shrinks by 128 bytes.

Fixed small values like 10**-323 being 0 instead of 1e-323.

Overall precision is increased but still not as good as
predefined constants for some inputs.

Samples:

Pow10(208)
before: 1.0000000000000006662e+208
after:  1.0000000000000000959e+208

Pow10(202)
before 1.0000000000000009895e+202
after  1.0000000000000001193e+202

Pow10(60)
before 1.0000000000000001278e+60
after  0.9999999999999999494e+60

Pow10(-100)
before 0.99999999999999938551e-100
after  0.99999999999999989309e-100

Pow10(-200)
before 0.9999999999999988218e-200
after  1.0000000000000001271e-200

name        old time/op  new time/op  delta
Pow10Pos-4  44.6ns ± 2%   1.2ns ± 1%  -97.39%  (p=0.000 n=19+17)
Pow10Neg-4  50.8ns ± 1%   4.1ns ± 2%  -92.02%  (p=0.000 n=17+19)

Change-Id: If094034286b8ac64be3a95fd9e8ffa3d4ad39b31
Reviewed-on: https://go-review.googlesource.com/36331
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-22 19:17:04 +00:00
.github doc: improve issue template and contribution guidelines 2017-02-11 20:42:06 +00:00
api math/big: define Word as uint instead of uintptr 2017-02-21 19:31:40 +00:00
doc doc: use appropriate type to describe return value 2017-02-21 22:15:26 +00:00
lib/time lib/time: update tzdata to 2016j 2017-01-05 01:00:53 +00:00
misc runtime: enable/disable SIGPROF if needed when profiling 2017-02-09 18:53:34 +00:00
src math: speed up and improve accuracy of Pow10 2017-02-22 19:17:04 +00:00
test cmd/compile: suppress callsite signatures if any type is unknown 2017-02-22 17:55:45 +00:00
.gitattributes
.gitignore cmd/dist: move cmd/go z files to cmd/go/internal/cfg 2017-02-03 20:30:52 +00:00
AUTHORS A+C: automated update 2016-12-21 03:22:22 +00:00
CONTRIBUTING.md doc: improve issue template and contribution guidelines 2017-02-11 20:42:06 +00:00
CONTRIBUTORS A+C: automated update 2016-12-21 03:22:22 +00:00
favicon.ico website: recreate 16px and 32px favicon 2016-08-25 15:43:32 +00:00
LICENSE doc: revert copyright date to 2009 2016-06-01 22:40:04 +00:00
PATENTS
README.md readme: add attribution for the Gopher image 2017-02-03 19:39:41 +00:00
robots.txt

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://golang.org/dl/.

After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.

Contributing

Go is the work of hundreds of contributors. We appreciate your help!

To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html

Note that the Go project does not use GitHub pull requests, and that we use the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.