Average Error: 46.7 → 0.0
Time: 2.2s
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 248.47326712178204:\\ \;\;\;\;\frac{i \cdot i}{\mathsf{fma}\left(2 \cdot i, 2 \cdot i, -1\right) \cdot \left(2 \cdot 2\right)}\\ \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 248.47326712178204:\\
\;\;\;\;\frac{i \cdot i}{\mathsf{fma}\left(2 \cdot i, 2 \cdot i, -1\right) \cdot \left(2 \cdot 2\right)}\\

\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 r55093 = i;
        double r55094 = r55093 * r55093;
        double r55095 = r55094 * r55094;
        double r55096 = 2.0;
        double r55097 = r55096 * r55093;
        double r55098 = r55097 * r55097;
        double r55099 = r55095 / r55098;
        double r55100 = 1.0;
        double r55101 = r55098 - r55100;
        double r55102 = r55099 / r55101;
        return r55102;
}

double f(double i) {
        double r55103 = i;
        double r55104 = 248.47326712178204;
        bool r55105 = r55103 <= r55104;
        double r55106 = r55103 * r55103;
        double r55107 = 2.0;
        double r55108 = r55107 * r55103;
        double r55109 = 1.0;
        double r55110 = -r55109;
        double r55111 = fma(r55108, r55108, r55110);
        double r55112 = r55107 * r55107;
        double r55113 = r55111 * r55112;
        double r55114 = r55106 / r55113;
        double r55115 = 0.00390625;
        double r55116 = 1.0;
        double r55117 = 4.0;
        double r55118 = pow(r55103, r55117);
        double r55119 = r55116 / r55118;
        double r55120 = 0.015625;
        double r55121 = 2.0;
        double r55122 = pow(r55103, r55121);
        double r55123 = r55116 / r55122;
        double r55124 = 0.0625;
        double r55125 = fma(r55120, r55123, r55124);
        double r55126 = fma(r55115, r55119, r55125);
        double r55127 = r55105 ? r55114 : r55126;
        return r55127;
}

Error

Bits error versus i

Derivation

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

    1. Initial program 45.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}\]
    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 fma-neg0.0

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

    if 248.47326712178204 < i

    1. Initial program 48.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}\]
    2. Simplified32.8

      \[\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 248.47326712178204:\\ \;\;\;\;\frac{i \cdot i}{\mathsf{fma}\left(2 \cdot i, 2 \cdot i, -1\right) \cdot \left(2 \cdot 2\right)}\\ \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 2020062 +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)))