Average Error: 46.5 → 0.4
Time: 2.0s
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} \]
\[0.25 \cdot \frac{1}{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}
0.25 \cdot \frac{1}{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 (/ 1.0 (- 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 * (1.0 / (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.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. Taylor expanded in i around 0 15.9

    \[\leadsto \frac{\color{blue}{0.25 \cdot {i}^{2}}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1} \]
  3. Applied egg-rr16.3

    \[\leadsto \color{blue}{0.25 \cdot \frac{1}{\frac{\mathsf{fma}\left(i, i \cdot 4, -1\right)}{i \cdot i}}} \]
  4. Taylor expanded in i around 0 0.4

    \[\leadsto 0.25 \cdot \frac{1}{\color{blue}{4 - \frac{1}{{i}^{2}}}} \]
  5. Final simplification0.4

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

Reproduce

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