Average Error: 46.2 → 0.1
Time: 3.3s
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}\]
\[\frac{1}{2 + \frac{1}{i}} \cdot \frac{0.25}{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{1}{2 + \frac{1}{i}} \cdot \frac{0.25}{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
 (* (/ 1.0 (+ 2.0 (/ 1.0 i))) (/ 0.25 (- 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 (1.0 / (2.0 + (1.0 / i))) * (0.25 / (2.0 - (1.0 / i)));
}

Error

Bits error versus i

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 46.2

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

    \[\leadsto \color{blue}{\frac{0.25}{4 - \frac{1}{i \cdot i}}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity_binary64_11010.4

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

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

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

    \[\leadsto \frac{0.25}{\color{blue}{\left(\sqrt{4} + \frac{1}{i}\right) \cdot \left(\sqrt{4} - \frac{1}{i}\right)}}\]
  8. Applied *-un-lft-identity_binary64_11010.5

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

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

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

Reproduce

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