e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r190479 = a;
double r190480 = log(r190479);
double r190481 = b;
double r190482 = log(r190481);
double r190483 = r190480 + r190482;
double r190484 = exp(r190483);
return r190484;
}
double f(double a, double b) {
double r190485 = a;
double r190486 = b;
double r190487 = r190485 * r190486;
return r190487;
}




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.7
Simplified0
Final simplification0
herbie shell --seed 2020003 +o rules:numerics
(FPCore (a b)
:name "Exp of sum of logs"
:precision binary64
:herbie-target
(* a b)
(exp (+ (log a) (log b))))