?

Average Accuracy: 27.0% → 99.5%
Time: 3.3s
Precision: binary64
Cost: 576

?

\[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} \]
\[\frac{0.25}{4 - \frac{1}{i \cdot i}} \]
(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 (/ 0.25 (- 4.0 (/ 1.0 (* i i)))))
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) {
	return 0.25 / (4.0 - (1.0 / (i * i)));
}
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
    code = 0.25d0 / (4.0d0 - (1.0d0 / (i * i)))
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) {
	return 0.25 / (4.0 - (1.0 / (i * i)));
}
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):
	return 0.25 / (4.0 - (1.0 / (i * i)))
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)
	return Float64(0.25 / Float64(4.0 - Float64(1.0 / Float64(i * i))))
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 = code(i)
	tmp = 0.25 / (4.0 - (1.0 / (i * i)));
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_] := N[(0.25 / N[(4.0 - N[(1.0 / N[(i * i), $MachinePrecision]), $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}
\frac{0.25}{4 - \frac{1}{i \cdot i}}

Error?

Bogosity?

Bogosity

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 28.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. Simplified91.5%

    \[\leadsto \color{blue}{\frac{0.25}{4 - \frac{i}{{i}^{3}}}} \]
    Proof

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

    times-frac [=>]77.6

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

    associate-/l* [=>]77.6

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

    associate-/l* [=>]77.7

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

    associate-/l/ [=>]77.7

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

    associate-/r/ [=>]77.6

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

    associate-/l* [=>]77.6

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

    *-inverses [=>]77.6

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

    metadata-eval [=>]77.6

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

    associate-*l* [=>]77.6

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

    *-commutative [<=]77.6

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

    associate-/r* [=>]77.7

    \[ \color{blue}{\frac{\frac{i}{\left(2 \cdot i\right) \cdot 2}}{\frac{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1}{i \cdot i}}} \]
  3. Taylor expanded in i around 0 99.9%

    \[\leadsto \frac{0.25}{4 - \color{blue}{\frac{1}{{i}^{2}}}} \]
  4. Simplified99.9%

    \[\leadsto \frac{0.25}{4 - \color{blue}{\frac{1}{i \cdot i}}} \]
    Proof

    [Start]99.9

    \[ \frac{0.25}{4 - \frac{1}{{i}^{2}}} \]

    unpow2 [=>]99.9

    \[ \frac{0.25}{4 - \frac{1}{\color{blue}{i \cdot i}}} \]
  5. Final simplification99.9%

    \[\leadsto \frac{0.25}{4 - \frac{1}{i \cdot i}} \]

Alternatives

Alternative 1
Accuracy99.1%
Cost580
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5:\\ \;\;\;\;i \cdot \left(i \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \end{array} \]
Alternative 2
Accuracy98.8%
Cost452
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5:\\ \;\;\;\;i \cdot \left(i \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \end{array} \]
Alternative 3
Accuracy50.9%
Cost64
\[0.0625 \]

Error

Reproduce?

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