Average Error: 5.7 → 0
Time: 4.7s
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 r125655 = a;
        double r125656 = log(r125655);
        double r125657 = b;
        double r125658 = log(r125657);
        double r125659 = r125656 + r125658;
        double r125660 = exp(r125659);
        return r125660;
}

double f(double a, double b) {
        double r125661 = a;
        double r125662 = b;
        double r125663 = r125661 * r125662;
        return r125663;
}

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.5

    \[\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 2019294 
(FPCore (a b)
  :name "Exp of sum of logs"
  :precision binary64

  :herbie-target
  (* a b)

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