Average Error: 0.0 → 0.0
Time: 6.0s
Precision: 64
Internal Precision: 128
\[\frac{1 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}{2 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}\]
\[\frac{1 + \left(2 - \frac{2}{1 + t}\right) \cdot \left(2 - \frac{2}{1 + t}\right)}{2 + \left(2 - \frac{2}{1 + t}\right) \cdot \left(2 - \frac{2}{1 + t}\right)}\]

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 + \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right) \cdot \left(2 - \frac{\frac{2}{t}}{1 + \frac{1}{t}}\right)}{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}{\frac{1 + \left(2 - \frac{2}{1 + t}\right) \cdot \left(2 - \frac{2}{1 + t}\right)}{2 + \left(2 - \frac{2}{1 + t}\right) \cdot \left(2 - \frac{2}{1 + t}\right)}}\]
  3. Final simplification0.0

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

Reproduce

herbie shell --seed 2019016 
(FPCore (t)
  :name "Kahan p13 Example 2"
  (/ (+ 1 (* (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))) (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))))) (+ 2 (* (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))) (- 2 (/ (/ 2 t) (+ 1 (/ 1 t))))))))

Details

Time bar (total: 5.8s)Debug log

sample58.0ms

Algorithm
intervals
Results
256×(pre true 80)
256×(body real 80)

simplify134.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
134.0ms
(/ (+ 1 (* (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))) (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))))) (+ 2 (* (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))) (- 2 (/ (/ 2 t) (+ 1 (/ 1 t)))))))

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize40.0ms

Local error

Found 4 expressions with local error:

3.7b
(- 2 (/ 2 (+ 1 t)))
3.7b
(- 2 (/ 2 (+ 1 t)))
3.7b
(- 2 (/ 2 (+ 1 t)))
3.7b
(- 2 (/ 2 (+ 1 t)))

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
flip--
add-cube-cbrt
add-exp-log
add-cbrt-cube
flip3--
*-un-lft-identity
sub-neg
pow1
add-sqr-sqrt
Counts
4 → 44
Calls
4 calls:
Slowest
1.0ms
(- 2 (/ 2 (+ 1 t)))
1.0ms
(- 2 (/ 2 (+ 1 t)))
1.0ms
(- 2 (/ 2 (+ 1 t)))
1.0ms
(- 2 (/ 2 (+ 1 t)))

series53.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
16.0ms
(- 2 (/ 2 (+ 1 t)))
16.0ms
(- 2 (/ 2 (+ 1 t)))
11.0ms
(- 2 (/ 2 (+ 1 t)))
10.0ms
(- 2 (/ 2 (+ 1 t)))

simplify2.8s

Counts
12 → 56
Calls
12 calls:
Slowest
486.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
475.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
473.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
451.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
139.0ms
(- (+ (* 2 (/ 1 (pow t 2))) 2) (* 2 (/ 1 t)))

prune548.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0.0b

end0.0ms

sample2.1s

Algorithm
intervals
Results
8000×(pre true 80)
8000×(body real 80)