Average Error: 0.0 → 0.0
Time: 24.9s
Precision: 64
\[1 - \frac{1}{2 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}\]
\[1 - \frac{1}{\frac{\left(2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}\right) \cdot \frac{{2}^{6} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{6}}{{2}^{3} + {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}}}{\left(2 + \frac{2}{t \cdot 1 + 1}\right) \cdot \left(2 \cdot 2 + \frac{2}{t \cdot 1 + 1} \cdot \left(2 + \frac{2}{t \cdot 1 + 1}\right)\right)} + 2}\]
1 - \frac{1}{2 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}
1 - \frac{1}{\frac{\left(2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}\right) \cdot \frac{{2}^{6} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{6}}{{2}^{3} + {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}}}{\left(2 + \frac{2}{t \cdot 1 + 1}\right) \cdot \left(2 \cdot 2 + \frac{2}{t \cdot 1 + 1} \cdot \left(2 + \frac{2}{t \cdot 1 + 1}\right)\right)} + 2}
double f(double t) {
        double r41715 = 1.0;
        double r41716 = 2.0;
        double r41717 = t;
        double r41718 = r41716 / r41717;
        double r41719 = r41715 / r41717;
        double r41720 = r41715 + r41719;
        double r41721 = r41718 / r41720;
        double r41722 = r41716 - r41721;
        double r41723 = r41722 * r41722;
        double r41724 = r41716 + r41723;
        double r41725 = r41715 / r41724;
        double r41726 = r41715 - r41725;
        return r41726;
}

double f(double t) {
        double r41727 = 1.0;
        double r41728 = 2.0;
        double r41729 = r41728 * r41728;
        double r41730 = t;
        double r41731 = r41730 * r41727;
        double r41732 = r41731 + r41727;
        double r41733 = r41728 / r41732;
        double r41734 = r41733 * r41733;
        double r41735 = r41729 - r41734;
        double r41736 = 6.0;
        double r41737 = pow(r41728, r41736);
        double r41738 = pow(r41733, r41736);
        double r41739 = r41737 - r41738;
        double r41740 = 3.0;
        double r41741 = pow(r41728, r41740);
        double r41742 = pow(r41733, r41740);
        double r41743 = r41741 + r41742;
        double r41744 = r41739 / r41743;
        double r41745 = r41735 * r41744;
        double r41746 = r41728 + r41733;
        double r41747 = r41733 * r41746;
        double r41748 = r41729 + r41747;
        double r41749 = r41746 * r41748;
        double r41750 = r41745 / r41749;
        double r41751 = r41750 + r41728;
        double r41752 = r41727 / r41751;
        double r41753 = r41727 - r41752;
        return r41753;
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[1 - \frac{1}{2 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}\]
  2. Simplified0.0

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

    \[\leadsto 1 - \frac{1}{\left(2 - \frac{2}{t \cdot 1 + 1}\right) \cdot \color{blue}{\frac{2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}}{2 + \frac{2}{t \cdot 1 + 1}}} + 2}\]
  5. Applied flip3--0.0

    \[\leadsto 1 - \frac{1}{\color{blue}{\frac{{2}^{3} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}}{2 \cdot 2 + \left(\frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1} + 2 \cdot \frac{2}{t \cdot 1 + 1}\right)}} \cdot \frac{2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}}{2 + \frac{2}{t \cdot 1 + 1}} + 2}\]
  6. Applied frac-times0.0

    \[\leadsto 1 - \frac{1}{\color{blue}{\frac{\left({2}^{3} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}\right) \cdot \left(2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}\right)}{\left(2 \cdot 2 + \left(\frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1} + 2 \cdot \frac{2}{t \cdot 1 + 1}\right)\right) \cdot \left(2 + \frac{2}{t \cdot 1 + 1}\right)}} + 2}\]
  7. Simplified0.0

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

    \[\leadsto 1 - \frac{1}{\frac{\left(2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}\right) \cdot \left({2}^{3} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}\right)}{\color{blue}{\left(2 + \frac{2}{t \cdot 1 + 1}\right) \cdot \left(2 \cdot 2 + \frac{2}{t \cdot 1 + 1} \cdot \left(2 + \frac{2}{t \cdot 1 + 1}\right)\right)}} + 2}\]
  9. Using strategy rm
  10. Applied flip--0.0

    \[\leadsto 1 - \frac{1}{\frac{\left(2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}\right) \cdot \color{blue}{\frac{{2}^{3} \cdot {2}^{3} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3} \cdot {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}}{{2}^{3} + {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}}}}{\left(2 + \frac{2}{t \cdot 1 + 1}\right) \cdot \left(2 \cdot 2 + \frac{2}{t \cdot 1 + 1} \cdot \left(2 + \frac{2}{t \cdot 1 + 1}\right)\right)} + 2}\]
  11. Simplified0.0

    \[\leadsto 1 - \frac{1}{\frac{\left(2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}\right) \cdot \frac{\color{blue}{{2}^{6} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{6}}}{{2}^{3} + {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}}}{\left(2 + \frac{2}{t \cdot 1 + 1}\right) \cdot \left(2 \cdot 2 + \frac{2}{t \cdot 1 + 1} \cdot \left(2 + \frac{2}{t \cdot 1 + 1}\right)\right)} + 2}\]
  12. Final simplification0.0

    \[\leadsto 1 - \frac{1}{\frac{\left(2 \cdot 2 - \frac{2}{t \cdot 1 + 1} \cdot \frac{2}{t \cdot 1 + 1}\right) \cdot \frac{{2}^{6} - {\left(\frac{2}{t \cdot 1 + 1}\right)}^{6}}{{2}^{3} + {\left(\frac{2}{t \cdot 1 + 1}\right)}^{3}}}{\left(2 + \frac{2}{t \cdot 1 + 1}\right) \cdot \left(2 \cdot 2 + \frac{2}{t \cdot 1 + 1} \cdot \left(2 + \frac{2}{t \cdot 1 + 1}\right)\right)} + 2}\]

Reproduce

herbie shell --seed 2019325 
(FPCore (t)
  :name "Kahan p13 Example 3"
  :precision binary64
  (- 1 (/ 1 (+ 2 (* (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))) (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))))))))