Average Error: 46.5 → 0.0
Time: 2.0s
Precision: 64
\[i \gt 0.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}\]
\[\begin{array}{l} \mathbf{if}\;i \le 225.05596862785308:\\ \;\;\;\;\frac{i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \cdot \frac{i}{2 \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;0.00390625 \cdot \frac{1}{{i}^{4}} + \left(0.015625 \cdot \frac{1}{{i}^{2}} + 0.0625\right)\\ \end{array}\]
\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}
\begin{array}{l}
\mathbf{if}\;i \le 225.05596862785308:\\
\;\;\;\;\frac{i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \cdot \frac{i}{2 \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;0.00390625 \cdot \frac{1}{{i}^{4}} + \left(0.015625 \cdot \frac{1}{{i}^{2}} + 0.0625\right)\\

\end{array}
double f(double i) {
        double r55989 = i;
        double r55990 = r55989 * r55989;
        double r55991 = r55990 * r55990;
        double r55992 = 2.0;
        double r55993 = r55992 * r55989;
        double r55994 = r55993 * r55993;
        double r55995 = r55991 / r55994;
        double r55996 = 1.0;
        double r55997 = r55994 - r55996;
        double r55998 = r55995 / r55997;
        return r55998;
}

double f(double i) {
        double r55999 = i;
        double r56000 = 225.05596862785308;
        bool r56001 = r55999 <= r56000;
        double r56002 = 2.0;
        double r56003 = r56002 * r55999;
        double r56004 = r56003 * r56003;
        double r56005 = 1.0;
        double r56006 = r56004 - r56005;
        double r56007 = r55999 / r56006;
        double r56008 = r56002 * r56002;
        double r56009 = r55999 / r56008;
        double r56010 = r56007 * r56009;
        double r56011 = 0.00390625;
        double r56012 = 1.0;
        double r56013 = 4.0;
        double r56014 = pow(r55999, r56013);
        double r56015 = r56012 / r56014;
        double r56016 = r56011 * r56015;
        double r56017 = 0.015625;
        double r56018 = 2.0;
        double r56019 = pow(r55999, r56018);
        double r56020 = r56012 / r56019;
        double r56021 = r56017 * r56020;
        double r56022 = 0.0625;
        double r56023 = r56021 + r56022;
        double r56024 = r56016 + r56023;
        double r56025 = r56001 ? r56010 : r56024;
        return r56025;
}

Error

Bits error versus i

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if i < 225.05596862785308

    1. Initial program 44.9

      \[\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}\]
    2. Simplified0.0

      \[\leadsto \color{blue}{\frac{i \cdot i}{\left(\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1\right) \cdot \left(2 \cdot 2\right)}}\]
    3. Using strategy rm
    4. Applied times-frac0.0

      \[\leadsto \color{blue}{\frac{i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \cdot \frac{i}{2 \cdot 2}}\]

    if 225.05596862785308 < i

    1. Initial program 48.1

      \[\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}\]
    2. Simplified32.4

      \[\leadsto \color{blue}{\frac{i \cdot i}{\left(\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1\right) \cdot \left(2 \cdot 2\right)}}\]
    3. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{0.00390625 \cdot \frac{1}{{i}^{4}} + \left(0.015625 \cdot \frac{1}{{i}^{2}} + 0.0625\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \le 225.05596862785308:\\ \;\;\;\;\frac{i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \cdot \frac{i}{2 \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;0.00390625 \cdot \frac{1}{{i}^{4}} + \left(0.015625 \cdot \frac{1}{{i}^{2}} + 0.0625\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020003 
(FPCore (i)
  :name "Octave 3.8, jcobi/4, as called"
  :precision binary64
  :pre (and (> i 0.0))
  (/ (/ (* (* i i) (* i i)) (* (* 2 i) (* 2 i))) (- (* (* 2 i) (* 2 i)) 1)))