- opAssign
Dual opAssign(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opAssign
Dual opAssign(Dual!R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinary
Dual!(CommonType!(T, R)) opBinary(Dual!R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinary
Dual!(CommonType!(T, R)) opBinary(Dual!R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinary
Dual!(CommonType!(T, R)) opBinary(Dual!R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinary
Dual!(CommonType!(T, R)) opBinary(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinary
Dual!(CommonType!(T, R)) opBinary(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinary
Dual!T opBinary(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinaryRight
Dual!(CommonType!(T, R)) opBinaryRight(R lhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinaryRight
Dual!(CommonType!(T, R)) opBinaryRight(R lhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opBinaryRight
Dual!(CommonType!(T, R)) opBinaryRight(R lhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opCmp
int opCmp(Dual!R z)
Undocumented in source. Be warned that the author may not have intended to support it.
- opCmp
int opCmp(R r)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(Dual!R z)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(R r)
Undocumented in source. Be warned that the author may not have intended to support it.
- opOpAssign
Dual opOpAssign(D rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opOpAssign
Dual opOpAssign(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opOpAssign
Dual opOpAssign(R rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
- opUnary
Dual opUnary()
Undocumented in source. Be warned that the author may not have intended to support it.
- toString
string toString()
void toString(Writer w, FormatSpec!Char formatSpec)
Converts the dual number to a string representation.
The second form of this function is usually not called directly;
instead, it is used via std.string.format, as shown in the examples
below. Supported format characters are 'e', 'f', 'g', 'a', and 's'.
See the std.format and std.string.format
documentation for more information.
import std.math;
// f(x) = x⁵ f'(x) = 5x⁴ for x = 2
const x = Dual!double(2.0, 1.0);
auto f2 = x^^5;
assert(approxEqual(f2.re, 2.0^^5));
assert(approxEqual(f2.du, 5.0 * 2.0^^4));
// f(x) = 3x² f'(x) = 6x for x = 2
f2 = 3.0 * x * x;
assert(approxEqual(f2.re, 3.0 * 2.0 * 2.0));
assert(approxEqual(f2.du, 6.0 * 2.0));
// f(x) = 3/(1-x) f'(x) = 3/(1-x)^2 for x = 2
f2 = 3.0/(1.0 - x);
assert(approxEqual(f2.re, -3.0));
assert(approxEqual(f2.du, 3.0));
// f(x) = 3exp(2x), f'(x) = 6exp(2x) for x = 2
f2 = 3 * exp(2 * x);
assert(approxEqual(f2.re, 3 * std.math.exp(4.0)));
assert(approxEqual(f2.du, 6 * std.math.exp(4.0)));
Dual number for automatic differentation