Average Error: 45.4 → 0.0
Time: 11.3s
Precision: 64
Internal precision: 128
\[\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}\]
⬇
\[\begin{array}{l}
\mathbf{if}\;i \le 19424.958241307:\\
\;\;\;\;\frac{{\left(\frac{i}{2}\right)}^2}{{\left(i + i\right)}^2 - 1.0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{16} + \left(\frac{0.015625}{{i}^2} + \frac{0.00390625}{{i}^{4}}\right)\\
\end{array}\]
Derivation
- Split input into 2 regimes.
-
if i < 19424.958241307
Initial program 43.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.0}\]
Applied simplify 0.0
\[\leadsto \color{blue}{\frac{\frac{i}{2} \cdot \frac{i}{2}}{\left(i + i\right) \cdot \left(i + i\right) - 1.0}}\]
Applied simplify 0.0
\[\leadsto \frac{\color{blue}{{\left(\frac{i}{2}\right)}^2}}{\left(i + i\right) \cdot \left(i + i\right) - 1.0}\]
Applied simplify 0.0
\[\leadsto \frac{{\left(\frac{i}{2}\right)}^2}{\color{blue}{{\left(i + i\right)}^2 - 1.0}}\]
if 19424.958241307 < i
Initial program 46.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.0}\]
Applied simplify 30.7
\[\leadsto \color{blue}{\frac{\frac{i}{2} \cdot \frac{i}{2}}{\left(i + i\right) \cdot \left(i + i\right) - 1.0}}\]
Applied taylor 0
\[\leadsto 0.00390625 \cdot \frac{1}{{i}^{4}} + \left(\frac{1}{16} + 0.015625 \cdot \frac{1}{{i}^2}\right)\]
Taylor expanded around inf 0
\[\leadsto \color{blue}{0.00390625 \cdot \frac{1}{{i}^{4}} + \left(\frac{1}{16} + 0.015625 \cdot \frac{1}{{i}^2}\right)}\]
Applied simplify 0
\[\leadsto \color{blue}{\frac{1}{16} + \left(\frac{0.015625}{{i}^2} + \frac{0.00390625}{{i}^{4}}\right)}\]
- Recombined 2 regimes into one program.
- Removed slow pow expressions
Runtime
Please include this information when filing a bug report:
herbie --seed '#(1871352050 1505666426 380449713 3024348620 4207163781 470255120)'
(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)))