Average Error: 0.0 → 0.0
Time: 7.1s
Precision: 64
\[0.0 \le x \le 2\]
\[x \cdot \left(x \cdot x\right) + x \cdot x\]
\[e^{3 \cdot \log x} + x \cdot x\]
x \cdot \left(x \cdot x\right) + x \cdot x
e^{3 \cdot \log x} + x \cdot x
double f(double x) {
        double r6044840 = x;
        double r6044841 = r6044840 * r6044840;
        double r6044842 = r6044840 * r6044841;
        double r6044843 = r6044842 + r6044841;
        return r6044843;
}

double f(double x) {
        double r6044844 = 3.0;
        double r6044845 = x;
        double r6044846 = log(r6044845);
        double r6044847 = r6044844 * r6044846;
        double r6044848 = exp(r6044847);
        double r6044849 = r6044845 * r6044845;
        double r6044850 = r6044848 + r6044849;
        return r6044850;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\left(\left(1 + x\right) \cdot x\right) \cdot x\]

Derivation

  1. Initial program 0.0

    \[x \cdot \left(x \cdot x\right) + x \cdot x\]
  2. Using strategy rm
  3. Applied add-exp-log0.0

    \[\leadsto x \cdot \left(x \cdot \color{blue}{e^{\log x}}\right) + x \cdot x\]
  4. Applied add-exp-log0.0

    \[\leadsto x \cdot \left(\color{blue}{e^{\log x}} \cdot e^{\log x}\right) + x \cdot x\]
  5. Applied prod-exp0.0

    \[\leadsto x \cdot \color{blue}{e^{\log x + \log x}} + x \cdot x\]
  6. Applied add-exp-log0.0

    \[\leadsto \color{blue}{e^{\log x}} \cdot e^{\log x + \log x} + x \cdot x\]
  7. Applied prod-exp0.0

    \[\leadsto \color{blue}{e^{\log x + \left(\log x + \log x\right)}} + x \cdot x\]
  8. Simplified0.0

    \[\leadsto e^{\color{blue}{3 \cdot \log x}} + x \cdot x\]
  9. Final simplification0.0

    \[\leadsto e^{3 \cdot \log x} + x \cdot x\]

Reproduce

herbie shell --seed 2019174 
(FPCore (x)
  :name "Expression 3, p15"
  :pre (<= 0.0 x 2.0)

  :herbie-target
  (* (* (+ 1.0 x) x) x)

  (+ (* x (* x x)) (* x x)))