e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r170115 = a;
double r170116 = log(r170115);
double r170117 = b;
double r170118 = log(r170117);
double r170119 = r170116 + r170118;
double r170120 = exp(r170119);
return r170120;
}
double f(double a, double b) {
double r170121 = a;
double r170122 = b;
double r170123 = r170121 * r170122;
return r170123;
}




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