e^{\log a + \log b}a \cdot b
double f(double a, double b) {
double r184983 = a;
double r184984 = log(r184983);
double r184985 = b;
double r184986 = log(r184985);
double r184987 = r184984 + r184986;
double r184988 = exp(r184987);
return r184988;
}
double f(double a, double b) {
double r184989 = a;
double r184990 = b;
double r184991 = r184989 * r184990;
return r184991;
}




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