e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r162365 = a;
double r162366 = log(r162365);
double r162367 = b;
double r162368 = log(r162367);
double r162369 = r162366 + r162368;
double r162370 = exp(r162369);
return r162370;
}
double f(double a, double b) {
double r162371 = a;
double r162372 = b;
double r162373 = r162371 * r162372;
return r162373;
}




Bits error versus a




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