namespace rgpot::simd

Overview

namespace simd {
 
// namespaces
 
namespace rgpot::simd::detail;
 
// global functions
 
double exact_fma(double a, double b, double c);
double fma_trunc(double a, double b, double c);
double fma_quick(double a, double b, double c);
double mul_add(double a, double b, double c);
double r2_of(double dx, double dy, double dz);
double exp_fixed(double x);
RGPOT_SIMD_CLONES void exp_fixed_n(const double* x, double* out, std::size_t n);
 
} // namespace simd

Detailed Documentation

Global Functions

double exact_fma(double a, double b, double c)

a*b+c with one rounding, the same bits as a hardware fused multiply-add. Normals in range use a Dekker product and a round-to-odd sum (Boldo and Melquiond). Inputs outside that range and subnormal results use std::fma.

double mul_add(double a, double b, double c)

a*b+c, one rounding. A hardware instruction when this translation unit has one, or when fma_hw_active(). Otherwise fma_quick.

double r2_of(double dx, double dy, double dz)

dx^2 + dy^2 + dz^2. The first square is a multiply. The two sums fuse.

double exp_fixed(double x)

e^x with the same bits on every instruction set and C library. Within 1.24 ulp for normal results (see docs/orgmode/reference/simd_exp.org).

RGPOT_SIMD_CLONES void exp_fixed_n(const double* x, double* out, std::size_t n)

out[i] = exp_fixed(x[i]) for i < n. Vectorised and dispatched on the CPU at run time; every variant returns the bits of exp_fixed.