e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r139999 = a;
double r140000 = log(r139999);
double r140001 = b;
double r140002 = log(r140001);
double r140003 = r140000 + r140002;
double r140004 = exp(r140003);
return r140004;
}
double f(double a, double b) {
double r140005 = a;
double r140006 = b;
double r140007 = r140005 * r140006;
return r140007;
}




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