Average Error: 5.6 → 0
Time: 5.3s
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 r4521819 = a;
        double r4521820 = log(r4521819);
        double r4521821 = b;
        double r4521822 = log(r4521821);
        double r4521823 = r4521820 + r4521822;
        double r4521824 = exp(r4521823);
        return r4521824;
}

double f(double a, double b) {
        double r4521825 = a;
        double r4521826 = b;
        double r4521827 = r4521825 * r4521826;
        return r4521827;
}

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))))