e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r159790 = a;
double r159791 = log(r159790);
double r159792 = b;
double r159793 = log(r159792);
double r159794 = r159791 + r159793;
double r159795 = exp(r159794);
return r159795;
}
double f(double a, double b) {
double r159796 = a;
double r159797 = b;
double r159798 = r159796 * r159797;
return r159798;
}




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