e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r160672 = a;
double r160673 = log(r160672);
double r160674 = b;
double r160675 = log(r160674);
double r160676 = r160673 + r160675;
double r160677 = exp(r160676);
return r160677;
}
double f(double a, double b) {
double r160678 = a;
double r160679 = b;
double r160680 = r160678 * r160679;
return r160680;
}




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