?

Average Error: 46.9 → 0.0
Time: 4.3s
Precision: binary64
Cost: 836

?

\[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 10000000:\\ \;\;\;\;\frac{i}{i \cdot \left(i \cdot 16\right) + -4} \cdot i\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \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 10000000.0) (* (/ i (+ (* i (* i 16.0)) -4.0)) i) 0.0625))
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 <= 10000000.0) {
		tmp = (i / ((i * (i * 16.0)) + -4.0)) * i;
	} else {
		tmp = 0.0625;
	}
	return tmp;
}
real(8) function code(i)
    real(8), intent (in) :: i
    code = (((i * i) * (i * i)) / ((2.0d0 * i) * (2.0d0 * i))) / (((2.0d0 * i) * (2.0d0 * i)) - 1.0d0)
end function
real(8) function code(i)
    real(8), intent (in) :: i
    real(8) :: tmp
    if (i <= 10000000.0d0) then
        tmp = (i / ((i * (i * 16.0d0)) + (-4.0d0))) * i
    else
        tmp = 0.0625d0
    end if
    code = tmp
end function
public static double code(double i) {
	return (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0);
}
public static double code(double i) {
	double tmp;
	if (i <= 10000000.0) {
		tmp = (i / ((i * (i * 16.0)) + -4.0)) * i;
	} else {
		tmp = 0.0625;
	}
	return tmp;
}
def code(i):
	return (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0)
def code(i):
	tmp = 0
	if i <= 10000000.0:
		tmp = (i / ((i * (i * 16.0)) + -4.0)) * i
	else:
		tmp = 0.0625
	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 <= 10000000.0)
		tmp = Float64(Float64(i / Float64(Float64(i * Float64(i * 16.0)) + -4.0)) * i);
	else
		tmp = 0.0625;
	end
	return tmp
end
function tmp = code(i)
	tmp = (((i * i) * (i * i)) / ((2.0 * i) * (2.0 * i))) / (((2.0 * i) * (2.0 * i)) - 1.0);
end
function tmp_2 = code(i)
	tmp = 0.0;
	if (i <= 10000000.0)
		tmp = (i / ((i * (i * 16.0)) + -4.0)) * i;
	else
		tmp = 0.0625;
	end
	tmp_2 = 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, 10000000.0], N[(N[(i / N[(N[(i * N[(i * 16.0), $MachinePrecision]), $MachinePrecision] + -4.0), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], 0.0625]
\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 10000000:\\
\;\;\;\;\frac{i}{i \cdot \left(i \cdot 16\right) + -4} \cdot i\\

\mathbf{else}:\\
\;\;\;\;0.0625\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

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

    1. Initial program 44.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. Simplified0.0

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

      [Start]44.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} \]

      rational.json-simplify-44 [=>]44.5

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

      rational.json-simplify-35 [=>]44.5

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

      rational.json-simplify-44 [=>]44.5

      \[ \color{blue}{\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right) + \left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1\right) + \left(\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1\right)}} \]
    3. Applied egg-rr0.0

      \[\leadsto \color{blue}{\frac{i}{i \cdot \left(i \cdot 16\right) + -4} \cdot i} \]

    if 1e7 < i

    1. Initial program 49.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. Simplified33.4

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

      [Start]49.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} \]

      rational.json-simplify-44 [=>]49.5

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

      rational.json-simplify-35 [=>]49.5

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

      rational.json-simplify-44 [=>]49.5

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

      \[\leadsto \color{blue}{0.0625} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq 10000000:\\ \;\;\;\;\frac{i}{i \cdot \left(i \cdot 16\right) + -4} \cdot i\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \end{array} \]

Alternatives

Alternative 1
Error0.7
Cost452
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5:\\ \;\;\;\;\left(-0.25 \cdot i\right) \cdot i\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \end{array} \]
Alternative 2
Error31.4
Cost64
\[0.0625 \]

Error

Reproduce?

herbie shell --seed 2023075 
(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)))