(FPCore (a b) :precision binary64 (log (+ (exp a) (exp b))))
(FPCore (a b)
:precision binary64
(let* ((t_0 (log1p (exp a))) (t_1 (cbrt t_0)))
(+
t_0
(/ b (pow (exp (pow (pow (pow (cbrt (cbrt t_1)) 3.0) 3.0) 2.0)) t_1)))))double code(double a, double b) {
return log((exp(a) + exp(b)));
}
double code(double a, double b) {
double t_0 = log1p(exp(a));
double t_1 = cbrt(t_0);
return t_0 + (b / pow(exp(pow(pow(pow(cbrt(cbrt(t_1)), 3.0), 3.0), 2.0)), t_1));
}
public static double code(double a, double b) {
return Math.log((Math.exp(a) + Math.exp(b)));
}
public static double code(double a, double b) {
double t_0 = Math.log1p(Math.exp(a));
double t_1 = Math.cbrt(t_0);
return t_0 + (b / Math.pow(Math.exp(Math.pow(Math.pow(Math.pow(Math.cbrt(Math.cbrt(t_1)), 3.0), 3.0), 2.0)), t_1));
}
function code(a, b) return log(Float64(exp(a) + exp(b))) end
function code(a, b) t_0 = log1p(exp(a)) t_1 = cbrt(t_0) return Float64(t_0 + Float64(b / (exp((((cbrt(cbrt(t_1)) ^ 3.0) ^ 3.0) ^ 2.0)) ^ t_1))) end
code[a_, b_] := N[Log[N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[a_, b_] := Block[{t$95$0 = N[Log[1 + N[Exp[a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 1/3], $MachinePrecision]}, N[(t$95$0 + N[(b / N[Power[N[Exp[N[Power[N[Power[N[Power[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 3.0], $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision], t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\log \left(e^{a} + e^{b}\right)
\begin{array}{l}
t_0 := \mathsf{log1p}\left(e^{a}\right)\\
t_1 := \sqrt[3]{t_0}\\
t_0 + \frac{b}{{\left(e^{{\left({\left({\left(\sqrt[3]{\sqrt[3]{t_1}}\right)}^{3}\right)}^{3}\right)}^{2}}\right)}^{t_1}}
\end{array}
Results
Initial program 29.8
Taylor expanded in b around 0 1.2
Simplified1.1
Applied egg-rr1.1
Applied egg-rr1.1
Applied egg-rr1.1
Final simplification1.1
herbie shell --seed 2022204
(FPCore (a b)
:name "symmetry log of sum of exp"
:precision binary64
(log (+ (exp a) (exp b))))