e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r142666 = a;
double r142667 = log(r142666);
double r142668 = b;
double r142669 = log(r142668);
double r142670 = r142667 + r142669;
double r142671 = exp(r142670);
return r142671;
}
double f(double a, double b) {
double r142672 = a;
double r142673 = b;
double r142674 = r142672 * r142673;
return r142674;
}




Bits error versus a




Bits error versus b
Results
| Original | 5.7 |
|---|---|
| Target | 0 |
| Herbie | 0 |
Initial program 5.7
rmApplied exp-sum5.5
Simplified4.8
Simplified0
Final simplification0
herbie shell --seed 2020001 +o rules:numerics
(FPCore (a b)
:name "Exp of sum of logs"
:precision binary64
:herbie-target
(* a b)
(exp (+ (log a) (log b))))