e^{\log a + \log b}b \cdot a
double f(double a, double b) {
double r112005 = a;
double r112006 = log(r112005);
double r112007 = b;
double r112008 = log(r112007);
double r112009 = r112006 + r112008;
double r112010 = exp(r112009);
return r112010;
}
double f(double a, double b) {
double r112011 = b;
double r112012 = a;
double r112013 = r112011 * r112012;
return r112013;
}




Bits error versus a




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