Average Error: 46.8 → 0.3
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{0.25}{4 + \frac{-1}{{i}^{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}
\frac{0.25}{4 + \frac{-1}{{i}^{2}}}
(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 (pow i 2.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) {
	return 0.25 / (4.0 + (-1.0 / pow(i, 2.0)));
}

Error

Bits error versus i

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 46.8

    \[\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. Applied *-un-lft-identity_binary640.3

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

    \[\leadsto \frac{0.25}{4 - \color{blue}{\frac{1}{i} \cdot \frac{1}{i}}} \]
  5. Applied cancel-sign-sub-inv_binary640.4

    \[\leadsto \frac{0.25}{\color{blue}{4 + \left(-\frac{1}{i}\right) \cdot \frac{1}{i}}} \]
  6. Taylor expanded in i around 0 0.3

    \[\leadsto \frac{0.25}{4 + \color{blue}{\frac{-1}{{i}^{2}}}} \]
  7. Final simplification0.3

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

Reproduce

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