Average Error: 46.0 → 0.0
Time: 1.6s
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 219.86646907900064:\\ \;\;\;\;\frac{i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \cdot \frac{i}{2 \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.00390625, \frac{1}{{i}^{4}}, \mathsf{fma}\left(0.015625, \frac{1}{{i}^{2}}, 0.0625\right)\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 219.86646907900064:\\
\;\;\;\;\frac{i}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \cdot \frac{i}{2 \cdot 2}\\

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

\end{array}
double f(double i) {
        double r107486 = i;
        double r107487 = r107486 * r107486;
        double r107488 = r107487 * r107487;
        double r107489 = 2.0;
        double r107490 = r107489 * r107486;
        double r107491 = r107490 * r107490;
        double r107492 = r107488 / r107491;
        double r107493 = 1.0;
        double r107494 = r107491 - r107493;
        double r107495 = r107492 / r107494;
        return r107495;
}

double f(double i) {
        double r107496 = i;
        double r107497 = 219.86646907900064;
        bool r107498 = r107496 <= r107497;
        double r107499 = 2.0;
        double r107500 = r107499 * r107496;
        double r107501 = r107500 * r107500;
        double r107502 = 1.0;
        double r107503 = r107501 - r107502;
        double r107504 = r107496 / r107503;
        double r107505 = r107499 * r107499;
        double r107506 = r107496 / r107505;
        double r107507 = r107504 * r107506;
        double r107508 = 0.00390625;
        double r107509 = 1.0;
        double r107510 = 4.0;
        double r107511 = pow(r107496, r107510);
        double r107512 = r107509 / r107511;
        double r107513 = 0.015625;
        double r107514 = 2.0;
        double r107515 = pow(r107496, r107514);
        double r107516 = r107509 / r107515;
        double r107517 = 0.0625;
        double r107518 = fma(r107513, r107516, r107517);
        double r107519 = fma(r107508, r107512, r107518);
        double r107520 = r107498 ? r107507 : r107519;
        return r107520;
}

Error

Bits error versus i

Derivation

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

    1. Initial program 44.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. 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 219.86646907900064 < i

    1. Initial program 47.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. Simplified31.1

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

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

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

Reproduce

herbie shell --seed 2020064 +o rules:numerics
(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)))