Average Error: 0.1 → 0.1
Time: 9.5s
Precision: 64
\[\left(\left(\frac{5}{4} \cdot b\right) \cdot b + 2 \cdot b\right) + 1\]
\[\left(1.25 \cdot \left(b \cdot b\right) + b \cdot 2\right) + 1\]
\left(\left(\frac{5}{4} \cdot b\right) \cdot b + 2 \cdot b\right) + 1
\left(1.25 \cdot \left(b \cdot b\right) + b \cdot 2\right) + 1
double f(double b) {
        double r4713763 = 5.0;
        double r4713764 = 4.0;
        double r4713765 = r4713763 / r4713764;
        double r4713766 = b;
        double r4713767 = r4713765 * r4713766;
        double r4713768 = r4713767 * r4713766;
        double r4713769 = 2.0;
        double r4713770 = r4713769 * r4713766;
        double r4713771 = r4713768 + r4713770;
        double r4713772 = 1.0;
        double r4713773 = r4713771 + r4713772;
        return r4713773;
}

double f(double b) {
        double r4713774 = 1.25;
        double r4713775 = b;
        double r4713776 = r4713775 * r4713775;
        double r4713777 = r4713774 * r4713776;
        double r4713778 = 2.0;
        double r4713779 = r4713775 * r4713778;
        double r4713780 = r4713777 + r4713779;
        double r4713781 = 1.0;
        double r4713782 = r4713780 + r4713781;
        return r4713782;
}

Error

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\left(\left(\frac{5}{4} \cdot b\right) \cdot b + 2 \cdot b\right) + 1\]
  2. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{\left(2 \cdot b + 1.25 \cdot {b}^{2}\right)} + 1\]
  3. Simplified0.1

    \[\leadsto \color{blue}{\left(1.25 \cdot \left(b \cdot b\right) + b \cdot 2\right)} + 1\]
  4. Final simplification0.1

    \[\leadsto \left(1.25 \cdot \left(b \cdot b\right) + b \cdot 2\right) + 1\]

Reproduce

herbie shell --seed 1 
(FPCore (b)
  :name "(5/4)*b*b+2*b+1"
  (+ (+ (* (* (/ 5.0 4.0) b) b) (* 2.0 b)) 1.0))