Average Error: 0.0 → 0.0
Time: 10.9s
Precision: 64
Internal Precision: 128
\[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}{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

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

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

Reproduce

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

Details

Time bar (total: 10.7s)Debug log

sample77.0ms

Algorithm
intervals
Results
63.0ms256×body80valid

simplify442.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
442.0ms
(- 1 (/ 1 (+ 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: 0b

localize23.0ms

Local error

Found 4 expressions with local error:

3.3b
(- 2 (/ 2 (+ 1 t)))
3.3b
(- 2 (/ 2 (+ 1 t)))
0.0b
(/ 1 (+ 2 (* (- 2 (/ 2 (+ 1 t))) (- 2 (/ 2 (+ 1 t))))))
0.0b
(* (- 2 (/ 2 (+ 1 t))) (- 2 (/ 2 (+ 1 t))))

rewrite7.0ms

Algorithm
rewrite-expression-head
Rules
10×pow1
flip--
flip3--
add-cube-cbrt
add-exp-log
*-un-lft-identity
add-sqr-sqrt
add-cbrt-cube
add-log-exp
sub-neg
frac-times
associate-*l*
associate-*r*
associate-/r*
associate-/r/
associate-*r/
associate-*l/
distribute-lft-in
distribute-rgt-in
inv-pow
pow-flip
div-inv
flip-+
cbrt-unprod
pow-prod-up
*-commutative
prod-exp
pow-prod-down
pow-plus
flip3-+
frac-2neg
clear-num
rec-exp
pow2
Counts
4 → 72
Calls
4 calls:
Slowest
5.0ms
(* (- 2 (/ 2 (+ 1 t))) (- 2 (/ 2 (+ 1 t))))
1.0ms
(/ 1 (+ 2 (* (- 2 (/ 2 (+ 1 t))) (- 2 (/ 2 (+ 1 t))))))
1.0ms
(- 2 (/ 2 (+ 1 t)))
0.0ms
(- 2 (/ 2 (+ 1 t)))

series83.0ms

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

simplify7.4s

Counts
45 → 84
Calls
45 calls:
Slowest
675.0ms
(* (- (pow 2 3) (pow (/ 2 (+ 1 t)) 3)) (- (pow 2 3) (pow (/ 2 (+ 1 t)) 3)))
615.0ms
(* (- (pow 2 3) (pow (/ 2 (+ 1 t)) 3)) (- 2 (/ 2 (+ 1 t))))
568.0ms
(* (+ (* 2 2) (+ (* (/ 2 (+ 1 t)) (/ 2 (+ 1 t))) (* 2 (/ 2 (+ 1 t))))) (+ (* 2 2) (+ (* (/ 2 (+ 1 t)) (/ 2 (+ 1 t))) (* 2 (/ 2 (+ 1 t))))))
490.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
481.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))

prune639.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample2.0s

Algorithm
intervals
Results
1.8s8000×body80valid