Average Error: 46.4 → 0.1
Time: 4.5s
Precision: binary64
Cost: 960
\[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.5}{2 + \frac{1}{i}} \cdot \frac{0.5}{2 - \frac{1}{i}}\]
\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.5}{2 + \frac{1}{i}} \cdot \frac{0.5}{2 - \frac{1}{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.5 (+ 2.0 (/ 1.0 i))) (/ 0.5 (- 2.0 (/ 1.0 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.5 / (2.0 + (1.0 / i))) * (0.5 / (2.0 - (1.0 / i)));
}

Error

Bits error versus i

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.1
Cost832
\[\frac{\frac{0.25}{2 - \frac{1}{i}}}{2 + \frac{1}{i}}\]
Alternative 2
Error0.3
Cost576
\[\frac{0.25}{4 - \frac{1}{i \cdot i}}\]
Alternative 3
Error0.4
Cost576
\[\frac{0.25}{4 - \frac{\frac{1}{i}}{i}}\]
Alternative 4
Error0.5
Cost769
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5123809118653021:\\ \;\;\;\;i \cdot \left(i \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625 + \frac{0.015625}{i \cdot i}\\ \end{array}\]
Alternative 5
Error0.7
Cost641
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5123809118653021:\\ \;\;\;\;i \cdot \left(i \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \end{array}\]
Alternative 6
Error0.7
Cost641
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5123809118653021:\\ \;\;\;\;\left(i \cdot i\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \end{array}\]
Alternative 7
Error16.2
Cost385
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5123809118653021:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.0625\\ \end{array}\]
Alternative 8
Error43.0
Cost385
\[\begin{array}{l} \mathbf{if}\;i \leq 0.5123809118653021:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 9
Error58.1
Cost64
\[1\]

Error

Derivation

  1. Initial program 46.4

    \[\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.3

    \[\leadsto \color{blue}{\frac{0.25}{4 - \frac{1}{i \cdot i}}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt_binary64_11230.3

    \[\leadsto \frac{0.25}{4 - \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{i \cdot i}}\]
  5. Applied times-frac_binary64_11070.5

    \[\leadsto \frac{0.25}{4 - \color{blue}{\frac{\sqrt{1}}{i} \cdot \frac{\sqrt{1}}{i}}}\]
  6. Applied add-sqr-sqrt_binary64_11230.5

    \[\leadsto \frac{0.25}{\color{blue}{\sqrt{4} \cdot \sqrt{4}} - \frac{\sqrt{1}}{i} \cdot \frac{\sqrt{1}}{i}}\]
  7. Applied difference-of-squares_binary64_10700.5

    \[\leadsto \frac{0.25}{\color{blue}{\left(\sqrt{4} + \frac{\sqrt{1}}{i}\right) \cdot \left(\sqrt{4} - \frac{\sqrt{1}}{i}\right)}}\]
  8. Applied add-sqr-sqrt_binary64_11230.5

    \[\leadsto \frac{\color{blue}{\sqrt{0.25} \cdot \sqrt{0.25}}}{\left(\sqrt{4} + \frac{\sqrt{1}}{i}\right) \cdot \left(\sqrt{4} - \frac{\sqrt{1}}{i}\right)}\]
  9. Applied times-frac_binary64_11070.1

    \[\leadsto \color{blue}{\frac{\sqrt{0.25}}{\sqrt{4} + \frac{\sqrt{1}}{i}} \cdot \frac{\sqrt{0.25}}{\sqrt{4} - \frac{\sqrt{1}}{i}}}\]
  10. Simplified0.1

    \[\leadsto \color{blue}{\frac{0.5}{2 + \frac{1}{i}}} \cdot \frac{\sqrt{0.25}}{\sqrt{4} - \frac{\sqrt{1}}{i}}\]
  11. Simplified0.1

    \[\leadsto \frac{0.5}{2 + \frac{1}{i}} \cdot \color{blue}{\frac{0.5}{2 - \frac{1}{i}}}\]
  12. Simplified0.1

    \[\leadsto \color{blue}{\frac{0.5}{2 + \frac{1}{i}} \cdot \frac{0.5}{2 - \frac{1}{i}}}\]
  13. Final simplification0.1

    \[\leadsto \frac{0.5}{2 + \frac{1}{i}} \cdot \frac{0.5}{2 - \frac{1}{i}}\]

Reproduce

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