Sam Hocevar
|
d4c0c005d6
|
math: refactor real number constant declarations so that they are only
computed on demand with static initialisation.
|
12 年之前 |
Sam Hocevar
|
688c046414
|
math: add an sprintf() method to real numbers, and ensure they are always
fully initialised.
|
12 年之前 |
Sam Hocevar
|
28728814cc
|
core: replace usage of sin() or std::sin() with lol::sin() where appropriate.
|
12 年之前 |
Sam Hocevar
|
ade0514b15
|
math: add min(), max() and clamp() for half, real and vector types.
|
13 年之前 |
Sam Hocevar
|
56e4332597
|
build: reorganise math files in a single "math" directory, and get rid of the
"shader" source directory since we have "gpu".
|
13 年之前 |
Sam Hocevar
|
60a2e83d54
|
xbox: start working on an Xbox/Direct3D port.
|
13 年之前 |
Sam Hocevar
|
8bea4cf189
|
math: ensure real::fabs() is never chosen over std::fabs() for arguments
that are not explicitly real, even with namespace mistakes.
|
13 年之前 |
Sam Hocevar
|
bed5dea0c0
|
math: implement ulp() for reals, which returns the smallest real y > 0 such
that x + y != x, and nextafter() which behaves like the C function.
|
13 年之前 |
Sam Hocevar
|
a949a2cd08
|
math: fix an infinite loop in the real number print function.
|
13 年之前 |
Sam Hocevar
|
c4bad581a2
|
math: write a faster factorial method for use in exp() and sin(). These
functions are now about 20% faster.
|
13 年之前 |
Sam Hocevar
|
52e44ef8be
|
core: fix a few implicit 64-to-32-bit casts in the real methods.
|
13 年之前 |
Sam Hocevar
|
366644d43c
|
real: get rid of <<= and >>= operators; we can use ldexp() instead. As a
bonus, multiplication or division by a power of two will be optimised as
a shift of the exponent.
|
13 年之前 |
Sam Hocevar
|
578b35c806
|
real: fix a rounding bug in real number printing.
|
13 年之前 |
Sam Hocevar
|
2beb5d7b8c
|
core: placement new requires #include <new>, fixing that and a few other
missing includes.
|
13 年之前 |
Sam Hocevar
|
f56c72c53d
|
core: fix the sign of a negative real number raised to an even power, and
add the corresponding unit test.
|
13 年之前 |
Sam Hocevar
|
992c198a66
|
core: allow to build a real number using a string literal.
|
13 年之前 |
Sam Hocevar
|
c508dc2a4a
|
core: dynamically allocate mantissa for real numbers. One day we'll be able
to modify their precision at runtime.
|
13 年之前 |
Sam Hocevar
|
4e4e800572
|
core: implement the gamma function for reals using Spouge's formula.
|
13 年之前 |
Sam Hocevar
|
b6b8044442
|
core: implement frexp(), ldexp() and modf() for reals.
|
13 年之前 |
Sam Hocevar
|
b354e17ef3
|
core: implement log10, sinh and cosh for real numbers.
|
13 年之前 |
Sam Hocevar
|
1280301f27
|
core: implement pow() for real numbers; for now special cases such as
negative zero or negative nth roots are not handled.
|
13 年之前 |
Sam Hocevar
|
a66fc123c1
|
core: fix a bug in real::log() and real::log2() with values smaller than 1.
|
13 年之前 |
Sam Hocevar
|
4041166c56
|
core: improve sin() and exp() performance by replacing divisions with
multiplications where appropriate.
|
13 年之前 |
Sam Hocevar
|
2235e9c180
|
core: implement real methods cbrt(), log2(), exp2(), and copysign().
|
13 年之前 |
Sam Hocevar
|
efafb640b7
|
core: implement tan() for real numbers.
|
13 年之前 |
Sam Hocevar
|
5d9167bda0
|
core: fix an accuracy error in real::re() and real::sqrt() introduced in
the 16-to-32-bit refactoring.
|
13 年之前 |
Sam Hocevar
|
9ff54f59e3
|
core: encode real numbers using uint32_t rather than uint16_t.
|
13 年之前 |
Sam Hocevar
|
66a2ee6a40
|
core: remove most dependencies on real number size in the various math
functions.
|
13 年之前 |
Sam Hocevar
|
3282cf30bb
|
core: replace the cos(real) implementation with a simple call to
sin(pi/2-x). No loss in precision in theory.
|
13 年之前 |
Sam Hocevar
|
b7fa88e210
|
real: constrain sin() and cos() on real numbers so that they work properly
with large values. Until now they were evaluating the Taylor series even
for huge values.
|
13 年之前 |
Sam Hocevar
|
c5c4913bda
|
core: implement round() and fmod() for real numbers.
|
13 年之前 |
Sam Hocevar
|
064856b443
|
core: implement floor() and ceil() for real numbers.
|
13 年之前 |
Sam Hocevar
|
221f469c3f
|
core: implement asin() and acos() for real numbers and add unit tests for
these functions.
|
13 年之前 |
Sam Hocevar
|
d9cb8f2961
|
core: fix an accuracy error in sqrt() for arguments < 1.0.
|
13 年之前 |
Sam Hocevar
|
f5019d3930
|
core: implement atan() for real numbers.
|
13 年之前 |
Sam Hocevar
|
bbd75b80eb
|
core: add real constants for 0, 1, 2 and 10, and reorder static constants
so that their initialisation order ensures they have the proper values. Add
unit tests for these constants.
|
13 年之前 |
Sam Hocevar
|
1ffa994f4b
|
core: add boolean operators on real numbers, add unit tests for that,
and simplify the Remez code accordingly.
|
13 年之前 |
Sam Hocevar
|
8f400b6364
|
core: create global real number variables such as R_E, R_PI, R_LN2 etc.
|
13 年之前 |
Sam Hocevar
|
4822f02d8d
|
core: implement shift operators for reals; they're useful for fast
multiplications by integers, especially powers of two.
|
13 年之前 |
Sam Hocevar
|
ab03cdb118
|
core: improve exp() on reals: faster (constant time) and a lot more
accurate.
|
13 年之前 |
Sam Hocevar
|
f62946fc7b
|
core: implement log() for real numbers, and start documenting our next
improved implementation of exp(), which relies on log().
|
13 年之前 |
Sam Hocevar
|
593aa3af70
|
core: implement sin(), cos() and abs() for reals and fix a crash in the
addition and subtraction operators occurring when exponents were too
different.
|
13 年之前 |
Sam Hocevar
|
c0edb49ed6
|
core: add exp() for real numbers and fix the == operator.
|
13 年之前 |
Sam Hocevar
|
908b2b3b95
|
real: fix a bug in the real number multiplication when one of the arguments
is zero.
|
13 年之前 |
Sam Hocevar
|
02bcc443f6
|
core: add sqrt() for real numbers.
|
13 年之前 |
Sam Hocevar
|
58ee1d5b81
|
core: add operators +=, *= etc. to the real class, and refactor the
print() method so that it displays decimal values.
|
13 年之前 |
Sam Hocevar
|
058d88232d
|
core: add rounding to real->double conversion, fix a bug in the addition
code shortcut, fix bugs in the addition and subtraction, another one in
the multiplication code, and add new unit tests for most of these.
|
13 年之前 |
Sam Hocevar
|
cdc155c42b
|
core: allow to cast reals to doubles in addition to floats.
|
13 年之前 |
Sam Hocevar
|
325ea94821
|
core: implement division of reals and change their default precision
to 32 bigits.
|
13 年之前 |
Sam Hocevar
|
93479c2876
|
core: implement real subtraction.
|
13 年之前 |