Average Error: 46.5 → 0.4
Time: 2.1s
Precision: binary64
\[i > 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 \leq 26.34059804421463:\\ \;\;\;\;{\left(i \cdot \sqrt[3]{\frac{0.25}{i \cdot \mathsf{fma}\left(i, i \cdot 4, -1\right)}}\right)}^{3}\\ \mathbf{else}:\\ \;\;\;\;\left(0.0625 + \frac{0.015625}{i \cdot i}\right) + \frac{0.00390625}{{i}^{4}}\\ \end{array} \]
(FPCore (i)
 :precision binary64
 (/
  (/ (* (* i i) (* i i)) (* (* 2.0 i) (* 2.0 i)))
  (- (* (* 2.0 i) (* 2.0 i)) 1.0)))
(FPCore (i)
 :precision binary64
 (if (<= i 26.34059804421463)
   (pow (* i (cbrt (/ 0.25 (* i (fma i (* i 4.0) -1.0))))) 3.0)
   (+ (+ 0.0625 (/ 0.015625 (* i i))) (/ 0.00390625 (pow i 4.0)))))
double code(double i) {
	return (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0);
}
double code(double i) {
	double tmp;
	if (i <= 26.34059804421463) {
		tmp = pow((i * cbrt((0.25 / (i * fma(i, (i * 4.0), -1.0))))), 3.0);
	} else {
		tmp = (0.0625 + (0.015625 / (i * i))) + (0.00390625 / pow(i, 4.0));
	}
	return tmp;
}
function code(i)
	return Float64(Float64(Float64(Float64(i * i) * Float64(i * i)) / Float64(Float64(2.0 * i) * Float64(2.0 * i))) / Float64(Float64(Float64(2.0 * i) * Float64(2.0 * i)) - 1.0))
end
function code(i)
	tmp = 0.0
	if (i <= 26.34059804421463)
		tmp = Float64(i * cbrt(Float64(0.25 / Float64(i * fma(i, Float64(i * 4.0), -1.0))))) ^ 3.0;
	else
		tmp = Float64(Float64(0.0625 + Float64(0.015625 / Float64(i * i))) + Float64(0.00390625 / (i ^ 4.0)));
	end
	return tmp
end
code[i_] := N[(N[(N[(N[(i * i), $MachinePrecision] * N[(i * i), $MachinePrecision]), $MachinePrecision] / N[(N[(2.0 * i), $MachinePrecision] * N[(2.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(2.0 * i), $MachinePrecision] * N[(2.0 * i), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
code[i_] := If[LessEqual[i, 26.34059804421463], N[Power[N[(i * N[Power[N[(0.25 / N[(i * N[(i * N[(i * 4.0), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], N[(N[(0.0625 + N[(0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.00390625 / N[Power[i, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\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 \leq 26.34059804421463:\\
\;\;\;\;{\left(i \cdot \sqrt[3]{\frac{0.25}{i \cdot \mathsf{fma}\left(i, i \cdot 4, -1\right)}}\right)}^{3}\\

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


\end{array}

Error

Derivation

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

    1. Initial program 44.6

      \[\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. Simplified9.9

      \[\leadsto \color{blue}{{i}^{3} \cdot \frac{\frac{0.25}{i}}{\mathsf{fma}\left(i, i \cdot 4, -1\right)}} \]
    3. Applied egg-rr0.7

      \[\leadsto \color{blue}{{\left(i \cdot \sqrt[3]{\frac{0.25}{i \cdot \mathsf{fma}\left(i, i \cdot 4, -1\right)}}\right)}^{3}} \]

    if 26.34059804421463 < 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. Simplified43.0

      \[\leadsto \color{blue}{{i}^{3} \cdot \frac{\frac{0.25}{i}}{\mathsf{fma}\left(i, i \cdot 4, -1\right)}} \]
    3. Taylor expanded in i around inf 0.0

      \[\leadsto \color{blue}{0.00390625 \cdot \frac{1}{{i}^{4}} + \left(0.0625 + 0.015625 \cdot \frac{1}{{i}^{2}}\right)} \]
    4. Simplified0.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 26.34059804421463:\\ \;\;\;\;{\left(i \cdot \sqrt[3]{\frac{0.25}{i \cdot \mathsf{fma}\left(i, i \cdot 4, -1\right)}}\right)}^{3}\\ \mathbf{else}:\\ \;\;\;\;\left(0.0625 + \frac{0.015625}{i \cdot i}\right) + \frac{0.00390625}{{i}^{4}}\\ \end{array} \]

Reproduce

herbie shell --seed 2022203 
(FPCore (i)
  :name "Octave 3.8, jcobi/4, as called"
  :precision binary64
  :pre (> i 0.0)
  (/ (/ (* (* i i) (* i i)) (* (* 2.0 i) (* 2.0 i))) (- (* (* 2.0 i) (* 2.0 i)) 1.0)))