Average Error: 5.6 → 0
Time: 5.8s
Precision: 64
\[e^{\log a + \log b}\]
\[a \cdot b\]
e^{\log a + \log b}
a \cdot b
double f(double a, double b) {
        double r3822993 = a;
        double r3822994 = log(r3822993);
        double r3822995 = b;
        double r3822996 = log(r3822995);
        double r3822997 = r3822994 + r3822996;
        double r3822998 = exp(r3822997);
        return r3822998;
}

double f(double a, double b) {
        double r3822999 = a;
        double r3823000 = b;
        double r3823001 = r3822999 * r3823000;
        return r3823001;
}

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.6
Target0
Herbie0
\[a \cdot b\]

Derivation

  1. Initial program 5.6

    \[e^{\log a + \log b}\]
  2. Simplified0

    \[\leadsto \color{blue}{b \cdot a}\]
  3. Final simplification0

    \[\leadsto a \cdot b\]

Reproduce

herbie shell --seed 2019200 +o rules:numerics
(FPCore (a b)
  :name "Exp of sum of logs"

  :herbie-target
  (* a b)

  (exp (+ (log a) (log b))))