Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for frexp (0.12 sec)

  1. src/math/frexp.go

    // license that can be found in the LICENSE file.
    
    package math
    
    // Frexp breaks f into a normalized fraction
    // and an integral power of two.
    // It returns frac and exp satisfying f == frac × 2**exp,
    // with the absolute value of frac in the interval [½, 1).
    //
    // Special cases are:
    //
    //	Frexp(±0) = ±0, 0
    //	Frexp(±Inf) = ±Inf, 0
    //	Frexp(NaN) = NaN, 0
    func Frexp(f float64) (frac float64, exp int) {
    	if haveArchFrexp {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 929 bytes
    - Viewed (0)
  2. test/fixedbugs/bug056.go

    // Copyright 2009 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    func frexp() (a int, b float64) {
    	return 1, 2.0
    }
    
    func main() {
    	a, b := frexp();
    	_, _ = a, b;
    }
    
    /*
    bug056.go:8: illegal types for operand: AS
    	(<int32>INT32)
    	(<int32>INT32)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 04:49:30 UTC 2012
    - 364 bytes
    - Viewed (0)
  3. src/math/mod.go

    func mod(x, y float64) float64 {
    	if y == 0 || IsInf(x, 0) || IsNaN(x) || IsNaN(y) {
    		return NaN()
    	}
    	y = Abs(y)
    
    	yfr, yexp := Frexp(y)
    	r := x
    	if x < 0 {
    		r = -x
    	}
    
    	for r >= y {
    		rfr, rexp := Frexp(r)
    		if rfr < yfr {
    			rexp = rexp - 1
    		}
    		r = r - Ldexp(y, rexp-yexp)
    	}
    	if x < 0 {
    		r = -r
    	}
    	return r
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 903 bytes
    - Viewed (0)
  4. src/runtime/mkfastlog2table.go

    	return fastlog2Table
    }
    
    // log2 is a local copy of math.Log2 with an explicit float64 conversion
    // to disable FMA. This lets us generate the same output on all platforms.
    func log2(x float64) float64 {
    	frac, exp := math.Frexp(x)
    	// Make sure exact powers of two give an exact answer.
    	// Don't depend on Log(0.5)*(1/Ln2)+exp being exactly exp-1.
    	if frac == 0.5 {
    		return float64(exp - 1)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Jun 26 22:12:19 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  5. src/math/log10.go

    // The special cases are the same as for [Log].
    func Log2(x float64) float64 {
    	if haveArchLog2 {
    		return archLog2(x)
    	}
    	return log2(x)
    }
    
    func log2(x float64) float64 {
    	frac, exp := Frexp(x)
    	// Make sure exact powers of two give an exact answer.
    	// Don't depend on Log(0.5)*(1/Ln2)+exp being exactly exp-1.
    	if frac == 0.5 {
    		return float64(exp - 1)
    	}
    	return Log(frac)*(1/Ln2) + float64(exp)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 873 bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/stablehlo/utils/math_utils.cc

                                     int32_t& quantized_fraction, int32_t& shift) {
      if (!std::isfinite(double_multiplier) || double_multiplier <= 0) {
        return failure();
      }
      const double fraction = std::frexp(double_multiplier, &shift);
      quantized_fraction = static_cast<int32_t>(std::round(fraction * (1L << 15)));
      // Clip extreme values.  These are more than enough to overflow int8, the
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Mar 05 08:32:43 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  7. test/codegen/condmove.go

    	return a
    }
    
    //go:noinline
    func frexp(f float64) (frac float64, exp int) {
    	return 1.0, 4
    }
    
    //go:noinline
    func ldexp(frac float64, exp int) float64 {
    	return 1.0
    }
    
    // Generate a CMOV with a floating comparison and integer move.
    func cmovfloatint2(x, y float64) float64 {
    	yfr, yexp := 4.0, 5
    
    	r := x
    	for r >= y {
    		rfr, rexp := frexp(r)
    		if rfr < yfr {
    			rexp = rexp - 1
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 06 20:57:33 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  8. src/math/ldexp.go

    // Copyright 2009 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package math
    
    // Ldexp is the inverse of [Frexp].
    // It returns frac × 2**exp.
    //
    // Special cases are:
    //
    //	Ldexp(±0, exp) = ±0
    //	Ldexp(±Inf, exp) = ±Inf
    //	Ldexp(NaN, exp) = NaN
    func Ldexp(frac float64, exp int) float64 {
    	if haveArchLdexp {
    		return archLdexp(frac, exp)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/quantization/numerical_utils.cc

    //   used.
    QuantizedMultiplier QuantizeMultiplier(double double_multiplier) {
      if (double_multiplier < 1e-6) {
        return {0, 0};
      }
    
      int32_t shift;
      const double q = frexp(double_multiplier, &shift);
      int64_t quantized_multiplier = round(q * (1LL << 31));
      assert(quantized_multiplier <= (1LL << 31));
      if (quantized_multiplier == (1LL << 31)) {
        quantized_multiplier /= 2;
        ++shift;
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Oct 17 19:57:04 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  10. src/math/log.go

    	)
    
    	// special cases
    	switch {
    	case IsNaN(x) || IsInf(x, 1):
    		return x
    	case x < 0:
    		return NaN()
    	case x == 0:
    		return Inf(-1)
    	}
    
    	// reduce
    	f1, ki := Frexp(x)
    	if f1 < Sqrt2/2 {
    		f1 *= 2
    		ki--
    	}
    	f := f1 - 1
    	k := float64(ki)
    
    	// compute
    	s := f / (2 + f)
    	s2 := s * s
    	s4 := s2 * s2
    	t1 := s2 * (L1 + s4*(L3+s4*(L5+s4*L7)))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 3.9K bytes
    - Viewed (0)
Back to top