
(FPCore (a b) :precision binary64 (log (+ (exp a) (exp b))))
double code(double a, double b) {
return log((exp(a) + exp(b)));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = log((exp(a) + exp(b)))
end function
public static double code(double a, double b) {
return Math.log((Math.exp(a) + Math.exp(b)));
}
def code(a, b): return math.log((math.exp(a) + math.exp(b)))
function code(a, b) return log(Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = log((exp(a) + exp(b))); end
code[a_, b_] := N[Log[N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\log \left(e^{a} + e^{b}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b) :precision binary64 (log (+ (exp a) (exp b))))
double code(double a, double b) {
return log((exp(a) + exp(b)));
}
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = log((exp(a) + exp(b)))
end function
public static double code(double a, double b) {
return Math.log((Math.exp(a) + Math.exp(b)));
}
def code(a, b): return math.log((math.exp(a) + math.exp(b)))
function code(a, b) return log(Float64(exp(a) + exp(b))) end
function tmp = code(a, b) tmp = log((exp(a) + exp(b))); end
code[a_, b_] := N[Log[N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\log \left(e^{a} + e^{b}\right)
\end{array}
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.0) (/ b (+ 1.0 (exp a))) (log (+ (exp a) (exp b)))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.0) {
tmp = b / (1.0 + exp(a));
} else {
tmp = log((exp(a) + exp(b)));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (exp(a) <= 0.0d0) then
tmp = b / (1.0d0 + exp(a))
else
tmp = log((exp(a) + exp(b)))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = Math.log((Math.exp(a) + Math.exp(b)));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.0: tmp = b / (1.0 + math.exp(a)) else: tmp = math.log((math.exp(a) + math.exp(b))) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = log(Float64(exp(a) + exp(b))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
tmp = 0.0;
if (exp(a) <= 0.0)
tmp = b / (1.0 + exp(a));
else
tmp = log((exp(a) + exp(b)));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;\log \left(e^{a} + e^{b}\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (let* ((t_0 (+ 1.0 (exp a))) (t_1 (/ 1.0 t_0))) (+ (log t_0) (* b (+ t_1 (* 0.5 (* b (+ t_1 (/ -1.0 (pow t_0 2.0))))))))))
assert(a < b);
double code(double a, double b) {
double t_0 = 1.0 + exp(a);
double t_1 = 1.0 / t_0;
return log(t_0) + (b * (t_1 + (0.5 * (b * (t_1 + (-1.0 / pow(t_0, 2.0)))))));
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
real(8) :: t_1
t_0 = 1.0d0 + exp(a)
t_1 = 1.0d0 / t_0
code = log(t_0) + (b * (t_1 + (0.5d0 * (b * (t_1 + ((-1.0d0) / (t_0 ** 2.0d0)))))))
end function
assert a < b;
public static double code(double a, double b) {
double t_0 = 1.0 + Math.exp(a);
double t_1 = 1.0 / t_0;
return Math.log(t_0) + (b * (t_1 + (0.5 * (b * (t_1 + (-1.0 / Math.pow(t_0, 2.0)))))));
}
[a, b] = sort([a, b]) def code(a, b): t_0 = 1.0 + math.exp(a) t_1 = 1.0 / t_0 return math.log(t_0) + (b * (t_1 + (0.5 * (b * (t_1 + (-1.0 / math.pow(t_0, 2.0)))))))
a, b = sort([a, b]) function code(a, b) t_0 = Float64(1.0 + exp(a)) t_1 = Float64(1.0 / t_0) return Float64(log(t_0) + Float64(b * Float64(t_1 + Float64(0.5 * Float64(b * Float64(t_1 + Float64(-1.0 / (t_0 ^ 2.0)))))))) end
a, b = num2cell(sort([a, b])){:}
function tmp = code(a, b)
t_0 = 1.0 + exp(a);
t_1 = 1.0 / t_0;
tmp = log(t_0) + (b * (t_1 + (0.5 * (b * (t_1 + (-1.0 / (t_0 ^ 2.0)))))));
end
NOTE: a and b should be sorted in increasing order before calling this function.
code[a_, b_] := Block[{t$95$0 = N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, N[(N[Log[t$95$0], $MachinePrecision] + N[(b * N[(t$95$1 + N[(0.5 * N[(b * N[(t$95$1 + N[(-1.0 / N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_0 := 1 + e^{a}\\
t_1 := \frac{1}{t\_0}\\
\log t\_0 + b \cdot \left(t\_1 + 0.5 \cdot \left(b \cdot \left(t\_1 + \frac{-1}{{t\_0}^{2}}\right)\right)\right)
\end{array}
\end{array}
Initial program 49.7%
Taylor expanded in b around 0 70.6%
Final simplification70.6%
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (a b)
:precision binary64
(let* ((t_0 (+ 1.0 (exp a))))
(if (<= (exp a) 0.0)
(/ b t_0)
(+ (log t_0) (+ (* -0.25 (* a b)) (* b (+ 0.5 (* b 0.125))))))))assert(a < b);
double code(double a, double b) {
double t_0 = 1.0 + exp(a);
double tmp;
if (exp(a) <= 0.0) {
tmp = b / t_0;
} else {
tmp = log(t_0) + ((-0.25 * (a * b)) + (b * (0.5 + (b * 0.125))));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + exp(a)
if (exp(a) <= 0.0d0) then
tmp = b / t_0
else
tmp = log(t_0) + (((-0.25d0) * (a * b)) + (b * (0.5d0 + (b * 0.125d0))))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double t_0 = 1.0 + Math.exp(a);
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / t_0;
} else {
tmp = Math.log(t_0) + ((-0.25 * (a * b)) + (b * (0.5 + (b * 0.125))));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): t_0 = 1.0 + math.exp(a) tmp = 0 if math.exp(a) <= 0.0: tmp = b / t_0 else: tmp = math.log(t_0) + ((-0.25 * (a * b)) + (b * (0.5 + (b * 0.125)))) return tmp
a, b = sort([a, b]) function code(a, b) t_0 = Float64(1.0 + exp(a)) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / t_0); else tmp = Float64(log(t_0) + Float64(Float64(-0.25 * Float64(a * b)) + Float64(b * Float64(0.5 + Float64(b * 0.125))))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
t_0 = 1.0 + exp(a);
tmp = 0.0;
if (exp(a) <= 0.0)
tmp = b / t_0;
else
tmp = log(t_0) + ((-0.25 * (a * b)) + (b * (0.5 + (b * 0.125))));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function.
code[a_, b_] := Block[{t$95$0 = N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / t$95$0), $MachinePrecision], N[(N[Log[t$95$0], $MachinePrecision] + N[(N[(-0.25 * N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(b * N[(0.5 + N[(b * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_0 := 1 + e^{a}\\
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\log t\_0 + \left(-0.25 \cdot \left(a \cdot b\right) + b \cdot \left(0.5 + b \cdot 0.125\right)\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 60.1%
Taylor expanded in a around 0 60.1%
Final simplification70.6%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (let* ((t_0 (+ 1.0 (exp a)))) (if (<= (exp a) 0.0) (/ b t_0) (+ (log t_0) (* b (+ 0.5 (* b 0.125)))))))
assert(a < b);
double code(double a, double b) {
double t_0 = 1.0 + exp(a);
double tmp;
if (exp(a) <= 0.0) {
tmp = b / t_0;
} else {
tmp = log(t_0) + (b * (0.5 + (b * 0.125)));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + exp(a)
if (exp(a) <= 0.0d0) then
tmp = b / t_0
else
tmp = log(t_0) + (b * (0.5d0 + (b * 0.125d0)))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double t_0 = 1.0 + Math.exp(a);
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / t_0;
} else {
tmp = Math.log(t_0) + (b * (0.5 + (b * 0.125)));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): t_0 = 1.0 + math.exp(a) tmp = 0 if math.exp(a) <= 0.0: tmp = b / t_0 else: tmp = math.log(t_0) + (b * (0.5 + (b * 0.125))) return tmp
a, b = sort([a, b]) function code(a, b) t_0 = Float64(1.0 + exp(a)) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / t_0); else tmp = Float64(log(t_0) + Float64(b * Float64(0.5 + Float64(b * 0.125)))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
t_0 = 1.0 + exp(a);
tmp = 0.0;
if (exp(a) <= 0.0)
tmp = b / t_0;
else
tmp = log(t_0) + (b * (0.5 + (b * 0.125)));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function.
code[a_, b_] := Block[{t$95$0 = N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / t$95$0), $MachinePrecision], N[(N[Log[t$95$0], $MachinePrecision] + N[(b * N[(0.5 + N[(b * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_0 := 1 + e^{a}\\
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\log t\_0 + b \cdot \left(0.5 + b \cdot 0.125\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 60.1%
Taylor expanded in a around 0 60.1%
Final simplification70.6%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (let* ((t_0 (+ 1.0 (exp a)))) (if (<= (exp a) 0.0) (/ b t_0) (log (+ t_0 (* b (+ 1.0 (* b 0.5))))))))
assert(a < b);
double code(double a, double b) {
double t_0 = 1.0 + exp(a);
double tmp;
if (exp(a) <= 0.0) {
tmp = b / t_0;
} else {
tmp = log((t_0 + (b * (1.0 + (b * 0.5)))));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + exp(a)
if (exp(a) <= 0.0d0) then
tmp = b / t_0
else
tmp = log((t_0 + (b * (1.0d0 + (b * 0.5d0)))))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double t_0 = 1.0 + Math.exp(a);
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / t_0;
} else {
tmp = Math.log((t_0 + (b * (1.0 + (b * 0.5)))));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): t_0 = 1.0 + math.exp(a) tmp = 0 if math.exp(a) <= 0.0: tmp = b / t_0 else: tmp = math.log((t_0 + (b * (1.0 + (b * 0.5))))) return tmp
a, b = sort([a, b]) function code(a, b) t_0 = Float64(1.0 + exp(a)) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / t_0); else tmp = log(Float64(t_0 + Float64(b * Float64(1.0 + Float64(b * 0.5))))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
t_0 = 1.0 + exp(a);
tmp = 0.0;
if (exp(a) <= 0.0)
tmp = b / t_0;
else
tmp = log((t_0 + (b * (1.0 + (b * 0.5)))));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function.
code[a_, b_] := Block[{t$95$0 = N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / t$95$0), $MachinePrecision], N[Log[N[(t$95$0 + N[(b * N[(1.0 + N[(b * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_0 := 1 + e^{a}\\
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\log \left(t\_0 + b \cdot \left(1 + b \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 60.2%
associate-+r+60.2%
*-commutative60.2%
Simplified60.2%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.0) (/ b (+ 1.0 (exp a))) (log1p (+ (exp a) b))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.0) {
tmp = b / (1.0 + exp(a));
} else {
tmp = log1p((exp(a) + b));
}
return tmp;
}
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = Math.log1p((Math.exp(a) + b));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.0: tmp = b / (1.0 + math.exp(a)) else: tmp = math.log1p((math.exp(a) + b)) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = log1p(Float64(exp(a) + b)); end return tmp end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[(N[Exp[a], $MachinePrecision] + b), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(e^{a} + b\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 58.8%
associate-+r+58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in a around inf 58.8%
log1p-define58.9%
Simplified58.9%
Final simplification69.6%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (+ (log1p (exp a)) (/ b (+ 1.0 (exp a)))))
assert(a < b);
double code(double a, double b) {
return log1p(exp(a)) + (b / (1.0 + exp(a)));
}
assert a < b;
public static double code(double a, double b) {
return Math.log1p(Math.exp(a)) + (b / (1.0 + Math.exp(a)));
}
[a, b] = sort([a, b]) def code(a, b): return math.log1p(math.exp(a)) + (b / (1.0 + math.exp(a)))
a, b = sort([a, b]) function code(a, b) return Float64(log1p(exp(a)) + Float64(b / Float64(1.0 + exp(a)))) end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := N[(N[Log[1 + N[Exp[a], $MachinePrecision]], $MachinePrecision] + N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\mathsf{log1p}\left(e^{a}\right) + \frac{b}{1 + e^{a}}
\end{array}
Initial program 49.7%
Taylor expanded in b around 0 70.4%
log1p-define70.4%
Simplified70.4%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.0) (/ b (+ 1.0 (exp a))) (log1p (exp a))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.0) {
tmp = b / (1.0 + exp(a));
} else {
tmp = log1p(exp(a));
}
return tmp;
}
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = Math.log1p(Math.exp(a));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.0: tmp = b / (1.0 + math.exp(a)) else: tmp = math.log1p(math.exp(a)) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = log1p(exp(a)); end return tmp end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[1 + N[Exp[a], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(e^{a}\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 60.1%
log1p-define60.1%
Simplified60.1%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.0) (/ b (+ 1.0 (exp a))) (+ (* b (+ 0.5 (* b 0.125))) (+ (log 2.0) (* a (+ 0.5 (* a 0.125)))))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.0) {
tmp = b / (1.0 + exp(a));
} else {
tmp = (b * (0.5 + (b * 0.125))) + (log(2.0) + (a * (0.5 + (a * 0.125))));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (exp(a) <= 0.0d0) then
tmp = b / (1.0d0 + exp(a))
else
tmp = (b * (0.5d0 + (b * 0.125d0))) + (log(2.0d0) + (a * (0.5d0 + (a * 0.125d0))))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = (b * (0.5 + (b * 0.125))) + (Math.log(2.0) + (a * (0.5 + (a * 0.125))));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.0: tmp = b / (1.0 + math.exp(a)) else: tmp = (b * (0.5 + (b * 0.125))) + (math.log(2.0) + (a * (0.5 + (a * 0.125)))) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = Float64(Float64(b * Float64(0.5 + Float64(b * 0.125))) + Float64(log(2.0) + Float64(a * Float64(0.5 + Float64(a * 0.125))))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
tmp = 0.0;
if (exp(a) <= 0.0)
tmp = b / (1.0 + exp(a));
else
tmp = (b * (0.5 + (b * 0.125))) + (log(2.0) + (a * (0.5 + (a * 0.125))));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(0.5 + N[(b * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[2.0], $MachinePrecision] + N[(a * N[(0.5 + N[(a * 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(0.5 + b \cdot 0.125\right) + \left(\log 2 + a \cdot \left(0.5 + a \cdot 0.125\right)\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 60.1%
Taylor expanded in a around 0 60.1%
Taylor expanded in a around 0 59.5%
*-commutative59.5%
Simplified59.5%
Final simplification70.1%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.02) (/ b (+ 1.0 (exp a))) (log (+ 2.0 (+ b (* a (+ 1.0 (* a (+ 0.5 (* a 0.16666666666666666))))))))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.02) {
tmp = b / (1.0 + exp(a));
} else {
tmp = log((2.0 + (b + (a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))))))));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (exp(a) <= 0.02d0) then
tmp = b / (1.0d0 + exp(a))
else
tmp = log((2.0d0 + (b + (a * (1.0d0 + (a * (0.5d0 + (a * 0.16666666666666666d0))))))))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.02) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = Math.log((2.0 + (b + (a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))))))));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.02: tmp = b / (1.0 + math.exp(a)) else: tmp = math.log((2.0 + (b + (a * (1.0 + (a * (0.5 + (a * 0.16666666666666666)))))))) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.02) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = log(Float64(2.0 + Float64(b + Float64(a * Float64(1.0 + Float64(a * Float64(0.5 + Float64(a * 0.16666666666666666)))))))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
tmp = 0.0;
if (exp(a) <= 0.02)
tmp = b / (1.0 + exp(a));
else
tmp = log((2.0 + (b + (a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))))))));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.02], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[N[(2.0 + N[(b + N[(a * N[(1.0 + N[(a * N[(0.5 + N[(a * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0.02:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;\log \left(2 + \left(b + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0200000000000000004Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0200000000000000004 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 58.8%
associate-+r+58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in a around 0 58.1%
*-commutative58.1%
Simplified58.1%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.0) (/ b (+ 1.0 (exp a))) (log (+ 2.0 (+ b (* a (+ 1.0 (* a 0.5))))))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.0) {
tmp = b / (1.0 + exp(a));
} else {
tmp = log((2.0 + (b + (a * (1.0 + (a * 0.5))))));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (exp(a) <= 0.0d0) then
tmp = b / (1.0d0 + exp(a))
else
tmp = log((2.0d0 + (b + (a * (1.0d0 + (a * 0.5d0))))))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.0) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = Math.log((2.0 + (b + (a * (1.0 + (a * 0.5))))));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.0: tmp = b / (1.0 + math.exp(a)) else: tmp = math.log((2.0 + (b + (a * (1.0 + (a * 0.5)))))) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.0) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = log(Float64(2.0 + Float64(b + Float64(a * Float64(1.0 + Float64(a * 0.5)))))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
tmp = 0.0;
if (exp(a) <= 0.0)
tmp = b / (1.0 + exp(a));
else
tmp = log((2.0 + (b + (a * (1.0 + (a * 0.5))))));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[N[(2.0 + N[(b + N[(a * N[(1.0 + N[(a * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;\log \left(2 + \left(b + a \cdot \left(1 + a \cdot 0.5\right)\right)\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 58.8%
associate-+r+58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in a around 0 58.1%
+-commutative58.1%
*-commutative58.1%
Simplified58.1%
Final simplification69.1%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.02) (/ b (+ 1.0 (exp a))) (+ (log (+ b 2.0)) (/ a (+ b 2.0)))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.02) {
tmp = b / (1.0 + exp(a));
} else {
tmp = log((b + 2.0)) + (a / (b + 2.0));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (exp(a) <= 0.02d0) then
tmp = b / (1.0d0 + exp(a))
else
tmp = log((b + 2.0d0)) + (a / (b + 2.0d0))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.02) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = Math.log((b + 2.0)) + (a / (b + 2.0));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.02: tmp = b / (1.0 + math.exp(a)) else: tmp = math.log((b + 2.0)) + (a / (b + 2.0)) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.02) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = Float64(log(Float64(b + 2.0)) + Float64(a / Float64(b + 2.0))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
tmp = 0.0;
if (exp(a) <= 0.02)
tmp = b / (1.0 + exp(a));
else
tmp = log((b + 2.0)) + (a / (b + 2.0));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.02], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(b + 2.0), $MachinePrecision]], $MachinePrecision] + N[(a / N[(b + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0.02:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;\log \left(b + 2\right) + \frac{a}{b + 2}\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0200000000000000004Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0200000000000000004 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 58.8%
associate-+r+58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in a around 0 58.1%
Final simplification69.1%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= (exp a) 0.02) (/ b (+ 1.0 (exp a))) (log (+ a (+ b 2.0)))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (exp(a) <= 0.02) {
tmp = b / (1.0 + exp(a));
} else {
tmp = log((a + (b + 2.0)));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (exp(a) <= 0.02d0) then
tmp = b / (1.0d0 + exp(a))
else
tmp = log((a + (b + 2.0d0)))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double tmp;
if (Math.exp(a) <= 0.02) {
tmp = b / (1.0 + Math.exp(a));
} else {
tmp = Math.log((a + (b + 2.0)));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if math.exp(a) <= 0.02: tmp = b / (1.0 + math.exp(a)) else: tmp = math.log((a + (b + 2.0))) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (exp(a) <= 0.02) tmp = Float64(b / Float64(1.0 + exp(a))); else tmp = log(Float64(a + Float64(b + 2.0))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
tmp = 0.0;
if (exp(a) <= 0.02)
tmp = b / (1.0 + exp(a));
else
tmp = log((a + (b + 2.0)));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.02], N[(b / N[(1.0 + N[Exp[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Log[N[(a + N[(b + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0.02:\\
\;\;\;\;\frac{b}{1 + e^{a}}\\
\mathbf{else}:\\
\;\;\;\;\log \left(a + \left(b + 2\right)\right)\\
\end{array}
\end{array}
if (exp.f64 a) < 0.0200000000000000004Initial program 8.6%
Taylor expanded in b around 0 7.2%
associate-+r+7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in b around 0 100.0%
log1p-define100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
if 0.0200000000000000004 < (exp.f64 a) Initial program 64.3%
Taylor expanded in b around 0 58.8%
associate-+r+58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in a around 0 58.0%
+-commutative58.0%
associate-+l+58.0%
+-commutative58.0%
Simplified58.0%
Final simplification69.0%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (if (<= a -1.0) (* 0.125 (pow b 2.0)) (log (+ a (+ b 2.0)))))
assert(a < b);
double code(double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = 0.125 * pow(b, 2.0);
} else {
tmp = log((a + (b + 2.0)));
}
return tmp;
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.0d0)) then
tmp = 0.125d0 * (b ** 2.0d0)
else
tmp = log((a + (b + 2.0d0)))
end if
code = tmp
end function
assert a < b;
public static double code(double a, double b) {
double tmp;
if (a <= -1.0) {
tmp = 0.125 * Math.pow(b, 2.0);
} else {
tmp = Math.log((a + (b + 2.0)));
}
return tmp;
}
[a, b] = sort([a, b]) def code(a, b): tmp = 0 if a <= -1.0: tmp = 0.125 * math.pow(b, 2.0) else: tmp = math.log((a + (b + 2.0))) return tmp
a, b = sort([a, b]) function code(a, b) tmp = 0.0 if (a <= -1.0) tmp = Float64(0.125 * (b ^ 2.0)); else tmp = log(Float64(a + Float64(b + 2.0))); end return tmp end
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(a, b)
tmp = 0.0;
if (a <= -1.0)
tmp = 0.125 * (b ^ 2.0);
else
tmp = log((a + (b + 2.0)));
end
tmp_2 = tmp;
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := If[LessEqual[a, -1.0], N[(0.125 * N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision], N[Log[N[(a + N[(b + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1:\\
\;\;\;\;0.125 \cdot {b}^{2}\\
\mathbf{else}:\\
\;\;\;\;\log \left(a + \left(b + 2\right)\right)\\
\end{array}
\end{array}
if a < -1Initial program 9.9%
Taylor expanded in b around 0 98.5%
Taylor expanded in a around 0 18.2%
Taylor expanded in a around 0 3.2%
Taylor expanded in b around inf 5.2%
if -1 < a Initial program 64.1%
Taylor expanded in b around 0 59.1%
associate-+r+59.1%
+-commutative59.1%
Simplified59.1%
Taylor expanded in a around 0 58.3%
+-commutative58.3%
associate-+l+58.3%
+-commutative58.3%
Simplified58.3%
Final simplification44.2%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (log (+ b 2.0)))
assert(a < b);
double code(double a, double b) {
return log((b + 2.0));
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = log((b + 2.0d0))
end function
assert a < b;
public static double code(double a, double b) {
return Math.log((b + 2.0));
}
[a, b] = sort([a, b]) def code(a, b): return math.log((b + 2.0))
a, b = sort([a, b]) function code(a, b) return log(Float64(b + 2.0)) end
a, b = num2cell(sort([a, b])){:}
function tmp = code(a, b)
tmp = log((b + 2.0));
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := N[Log[N[(b + 2.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\log \left(b + 2\right)
\end{array}
Initial program 49.7%
Taylor expanded in b around 0 45.3%
associate-+r+45.3%
+-commutative45.3%
Simplified45.3%
Taylor expanded in a around 0 42.9%
Final simplification42.9%
NOTE: a and b should be sorted in increasing order before calling this function. (FPCore (a b) :precision binary64 (log 2.0))
assert(a < b);
double code(double a, double b) {
return log(2.0);
}
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(a, b)
real(8), intent (in) :: a
real(8), intent (in) :: b
code = log(2.0d0)
end function
assert a < b;
public static double code(double a, double b) {
return Math.log(2.0);
}
[a, b] = sort([a, b]) def code(a, b): return math.log(2.0)
a, b = sort([a, b]) function code(a, b) return log(2.0) end
a, b = num2cell(sort([a, b])){:}
function tmp = code(a, b)
tmp = log(2.0);
end
NOTE: a and b should be sorted in increasing order before calling this function. code[a_, b_] := N[Log[2.0], $MachinePrecision]
\begin{array}{l}
[a, b] = \mathsf{sort}([a, b])\\
\\
\log 2
\end{array}
Initial program 49.7%
Taylor expanded in a around 0 45.4%
log1p-define45.5%
Simplified45.5%
Taylor expanded in b around 0 43.7%
herbie shell --seed 2024092
(FPCore (a b)
:name "symmetry log of sum of exp"
:precision binary64
(log (+ (exp a) (exp b))))