Average Error: 0.0 → 0.0
Time: 2.9s
Precision: binary64
\[\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}}\]
\[\begin{array}{l} \mathbf{if}\;t \le -13.8815442743864121 \lor \neg \left(t \le -1.686778531644532 \cdot 10^{-310}\right):\\ \;\;\;\;\log \left(e^{\frac{1 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}{2 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + 2 \cdot \left(2 \cdot \left(t \cdot \frac{t}{\left(t + 1\right) \cdot \left(t + 1\right)}\right)\right)}{2 + 2 \cdot \left(2 \cdot \log \left({\left(e^{\frac{t}{\left(t + 1\right) \cdot \left(t + 1\right)}}\right)}^{t}\right)\right)}\\ \end{array}\]
\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}}
\begin{array}{l}
\mathbf{if}\;t \le -13.8815442743864121 \lor \neg \left(t \le -1.686778531644532 \cdot 10^{-310}\right):\\
\;\;\;\;\log \left(e^{\frac{1 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}{2 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1 + 2 \cdot \left(2 \cdot \left(t \cdot \frac{t}{\left(t + 1\right) \cdot \left(t + 1\right)}\right)\right)}{2 + 2 \cdot \left(2 \cdot \log \left({\left(e^{\frac{t}{\left(t + 1\right) \cdot \left(t + 1\right)}}\right)}^{t}\right)\right)}\\

\end{array}
double code(double t) {
	return ((double) (((double) (1.0 + ((double) (((double) (((double) (2.0 * t)) / ((double) (1.0 + t)))) * ((double) (((double) (2.0 * t)) / ((double) (1.0 + t)))))))) / ((double) (2.0 + ((double) (((double) (((double) (2.0 * t)) / ((double) (1.0 + t)))) * ((double) (((double) (2.0 * t)) / ((double) (1.0 + t))))))))));
}
double code(double t) {
	double VAR;
	if (((t <= -13.881544274386412) || !(t <= -1.68677853164453e-310))) {
		VAR = ((double) log(((double) exp(((double) (((double) (1.0 + ((double) pow(((double) sqrt(((double) (((double) (t / ((double) (t + 1.0)))) * 2.0)))), 4.0)))) / ((double) (2.0 + ((double) pow(((double) sqrt(((double) (((double) (t / ((double) (t + 1.0)))) * 2.0)))), 4.0))))))))));
	} else {
		VAR = ((double) (((double) (1.0 + ((double) (2.0 * ((double) (2.0 * ((double) (t * ((double) (t / ((double) (((double) (t + 1.0)) * ((double) (t + 1.0)))))))))))))) / ((double) (2.0 + ((double) (2.0 * ((double) (2.0 * ((double) log(((double) pow(((double) exp(((double) (t / ((double) (((double) (t + 1.0)) * ((double) (t + 1.0)))))))), t))))))))))));
	}
	return VAR;
}

Error

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if t < -13.8815442743864121 or -1.686778531644532e-310 < t

    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. Using strategy rm
    3. Applied add-log-exp0.0

      \[\leadsto \color{blue}{\log \left(e^{\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}}}\right)}\]
    4. Simplified0.0

      \[\leadsto \log \color{blue}{\left(e^{\frac{1 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}{2 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}}\right)}\]

    if -13.8815442743864121 < t < -1.686778531644532e-310

    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{1 + 2 \cdot \left(2 \cdot \left(t \cdot \frac{t}{\left(1 + t\right) \cdot \left(1 + t\right)}\right)\right)}{2 + 2 \cdot \left(2 \cdot \left(t \cdot \frac{t}{\left(1 + t\right) \cdot \left(1 + t\right)}\right)\right)}}\]
    3. Using strategy rm
    4. Applied add-log-exp0.0

      \[\leadsto \frac{1 + 2 \cdot \left(2 \cdot \left(t \cdot \frac{t}{\left(1 + t\right) \cdot \left(1 + t\right)}\right)\right)}{2 + 2 \cdot \left(2 \cdot \color{blue}{\log \left(e^{t \cdot \frac{t}{\left(1 + t\right) \cdot \left(1 + t\right)}}\right)}\right)}\]
    5. Simplified0.0

      \[\leadsto \frac{1 + 2 \cdot \left(2 \cdot \left(t \cdot \frac{t}{\left(1 + t\right) \cdot \left(1 + t\right)}\right)\right)}{2 + 2 \cdot \left(2 \cdot \log \color{blue}{\left({\left(e^{\frac{t}{\left(t + 1\right) \cdot \left(t + 1\right)}}\right)}^{t}\right)}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -13.8815442743864121 \lor \neg \left(t \le -1.686778531644532 \cdot 10^{-310}\right):\\ \;\;\;\;\log \left(e^{\frac{1 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}{2 + {\left(\sqrt{\frac{t}{t + 1} \cdot 2}\right)}^{4}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + 2 \cdot \left(2 \cdot \left(t \cdot \frac{t}{\left(t + 1\right) \cdot \left(t + 1\right)}\right)\right)}{2 + 2 \cdot \left(2 \cdot \log \left({\left(e^{\frac{t}{\left(t + 1\right) \cdot \left(t + 1\right)}}\right)}^{t}\right)\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2020181 
(FPCore (t)
  :name "Kahan p13 Example 1"
  :precision binary64
  (/ (+ 1.0 (* (/ (* 2.0 t) (+ 1.0 t)) (/ (* 2.0 t) (+ 1.0 t)))) (+ 2.0 (* (/ (* 2.0 t) (+ 1.0 t)) (/ (* 2.0 t) (+ 1.0 t))))))