e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r132175 = a;
double r132176 = log(r132175);
double r132177 = b;
double r132178 = log(r132177);
double r132179 = r132176 + r132178;
double r132180 = exp(r132179);
return r132180;
}
double f(double a, double b) {
double r132181 = a;
double r132182 = b;
double r132183 = r132181 * r132182;
return r132183;
}




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