Average Error: 0.0 → 0.1
Time: 1.0m
Precision: 64
Internal Precision: 128
\[\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
\[\frac{(\left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{\left(t \cdot 2\right) \cdot \frac{t \cdot 2}{1 + t}}{1 + t}\right) + -1)_*}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_* \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t} - 1\right)}\]

Error

Bits error versus t

Derivation

  1. Initial program 0.0

    \[\frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 1)_*}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_*}}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

    \[\leadsto \frac{\color{blue}{\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t} + 1}}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_*}\]
  5. Using strategy rm
  6. Applied flip-+0.0

    \[\leadsto \frac{\color{blue}{\frac{\left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) - 1 \cdot 1}{\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t} - 1}}}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_*}\]
  7. Applied associate-/l/0.0

    \[\leadsto \color{blue}{\frac{\left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) - 1 \cdot 1}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_* \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t} - 1\right)}}\]
  8. Simplified0.0

    \[\leadsto \frac{\color{blue}{(\left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) + -1)_*}}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_* \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t} - 1\right)}\]
  9. Using strategy rm
  10. Applied associate-*r/0.1

    \[\leadsto \frac{(\left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) \cdot \color{blue}{\left(\frac{\frac{t \cdot 2}{1 + t} \cdot \left(t \cdot 2\right)}{1 + t}\right)} + -1)_*}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_* \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t} - 1\right)}\]
  11. Final simplification0.1

    \[\leadsto \frac{(\left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{\left(t \cdot 2\right) \cdot \frac{t \cdot 2}{1 + t}}{1 + t}\right) + -1)_*}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_* \cdot \left(\frac{t \cdot 2}{1 + t} \cdot \frac{t \cdot 2}{1 + t} - 1\right)}\]

Reproduce

herbie shell --seed 2019030 +o rules:numerics
(FPCore (t)
  :name "Kahan p13 Example 1"
  (/ (+ 1 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t)))) (+ 2 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t))))))