Average Error: 45.5 → 0.3
Time: 12.6s
Precision: 64
\[i \gt 0\]
\[\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1.0}\]
\[\frac{i}{\left(i \cdot 4 - \frac{1.0}{i}\right) \cdot 4}\]
\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1.0}
\frac{i}{\left(i \cdot 4 - \frac{1.0}{i}\right) \cdot 4}
double f(double i) {
        double r2460650 = i;
        double r2460651 = r2460650 * r2460650;
        double r2460652 = r2460651 * r2460651;
        double r2460653 = 2.0;
        double r2460654 = r2460653 * r2460650;
        double r2460655 = r2460654 * r2460654;
        double r2460656 = r2460652 / r2460655;
        double r2460657 = 1.0;
        double r2460658 = r2460655 - r2460657;
        double r2460659 = r2460656 / r2460658;
        return r2460659;
}

double f(double i) {
        double r2460660 = i;
        double r2460661 = 4.0;
        double r2460662 = r2460660 * r2460661;
        double r2460663 = 1.0;
        double r2460664 = r2460663 / r2460660;
        double r2460665 = r2460662 - r2460664;
        double r2460666 = r2460665 * r2460661;
        double r2460667 = r2460660 / r2460666;
        return r2460667;
}

Error

Bits error versus i

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 45.5

    \[\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1.0}\]
  2. Simplified0.3

    \[\leadsto \color{blue}{\frac{i}{\left(4 \cdot i - \frac{1.0}{i}\right) \cdot 4}}\]
  3. Taylor expanded around 0 0.3

    \[\leadsto \frac{i}{\color{blue}{\left(4 \cdot i - 1.0 \cdot \frac{1}{i}\right)} \cdot 4}\]
  4. Simplified0.3

    \[\leadsto \frac{i}{\color{blue}{\left(i \cdot 4 - \frac{1.0}{i}\right)} \cdot 4}\]
  5. Final simplification0.3

    \[\leadsto \frac{i}{\left(i \cdot 4 - \frac{1.0}{i}\right) \cdot 4}\]

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (i)
  :name "Octave 3.8, jcobi/4, as called"
  :pre (and (> i 0))
  (/ (/ (* (* i i) (* i i)) (* (* 2 i) (* 2 i))) (- (* (* 2 i) (* 2 i)) 1.0)))