Average Error: 0.0 → 0.0
Time: 4.1s
Precision: 64
\[\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{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 1\right)}{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 2\right)}\]
\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{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 1\right)}{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 2\right)}
double code(double t) {
	return ((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)))));
}
double code(double t) {
	return (fma(((2.0 * t) / (1.0 + t)), ((2.0 * t) / (1.0 + t)), 1.0) / fma(((2.0 * t) / (1.0 + t)), ((2.0 * t) / (1.0 + t)), 2.0));
}

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

    \[\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 *-un-lft-identity0.0

    \[\leadsto \frac{1 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}}{\color{blue}{1 \cdot \left(2 + \frac{2 \cdot t}{1 + t} \cdot \frac{2 \cdot t}{1 + t}\right)}}\]
  4. Applied *-un-lft-identity0.0

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

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \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}}}\]
  6. Simplified0.0

    \[\leadsto \color{blue}{1} \cdot \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}}\]
  7. Simplified0.0

    \[\leadsto 1 \cdot \color{blue}{\frac{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 1\right)}{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 2\right)}}\]
  8. Final simplification0.0

    \[\leadsto \frac{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 1\right)}{\mathsf{fma}\left(\frac{2 \cdot t}{1 + t}, \frac{2 \cdot t}{1 + t}, 2\right)}\]

Reproduce

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