e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r159403 = a;
double r159404 = log(r159403);
double r159405 = b;
double r159406 = log(r159405);
double r159407 = r159404 + r159406;
double r159408 = exp(r159407);
return r159408;
}
double f(double a, double b) {
double r159409 = a;
double r159410 = b;
double r159411 = r159409 * r159410;
return r159411;
}




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 2020033 +o rules:numerics
(FPCore (a b)
:name "Exp of sum of logs"
:precision binary64
:herbie-target
(* a b)
(exp (+ (log a) (log b))))