e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r159155 = a;
double r159156 = log(r159155);
double r159157 = b;
double r159158 = log(r159157);
double r159159 = r159156 + r159158;
double r159160 = exp(r159159);
return r159160;
}
double f(double a, double b) {
double r159161 = a;
double r159162 = b;
double r159163 = r159161 * r159162;
return r159163;
}




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