Average Error: 5.7 → 0
Time: 4.2s
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 r54423 = a;
        double r54424 = log(r54423);
        double r54425 = b;
        double r54426 = log(r54425);
        double r54427 = r54424 + r54426;
        double r54428 = exp(r54427);
        return r54428;
}

double f(double a, double b) {
        double r54429 = a;
        double r54430 = b;
        double r54431 = r54429 * r54430;
        return r54431;
}

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.7
Target0
Herbie0
\[a \cdot b\]

Derivation

  1. Initial program 5.7

    \[e^{\log a + \log b}\]
  2. Using strategy rm
  3. Applied exp-sum5.4

    \[\leadsto \color{blue}{e^{\log a} \cdot e^{\log b}}\]
  4. Simplified4.7

    \[\leadsto \color{blue}{a} \cdot e^{\log b}\]
  5. Simplified0

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

    \[\leadsto a \cdot b\]

Reproduce

herbie shell --seed 2019308 
(FPCore (a b)
  :name "Exp of sum of logs"
  :precision binary64

  :herbie-target
  (* a b)

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