e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r185656 = a;
double r185657 = log(r185656);
double r185658 = b;
double r185659 = log(r185658);
double r185660 = r185657 + r185659;
double r185661 = exp(r185660);
return r185661;
}
double f(double a, double b) {
double r185662 = a;
double r185663 = b;
double r185664 = r185662 * r185663;
return r185664;
}




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.8
Simplified0
Final simplification0
herbie shell --seed 2020081 +o rules:numerics
(FPCore (a b)
:name "Exp of sum of logs"
:precision binary64
:herbie-target
(* a b)
(exp (+ (log a) (log b))))