Average Error: 0.0 → 0.0
Time: 9.1s
Precision: 64
Internal Precision: 128
\[\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{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 1)_*}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_*}\]

Error

Bits error versus t

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. Simplified0.0

    \[\leadsto \color{blue}{\frac{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 1)_*}{(\left(\frac{t \cdot 2}{1 + t}\right) \cdot \left(\frac{t \cdot 2}{1 + t}\right) + 2)_*}}\]
  3. Final simplification0.0

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

Reproduce

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

Details

Time bar (total: 9.0s)Debug log

sample52.0ms

Algorithm
intervals

simplify593.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

593.0ms
(/ (+ 1 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t)))) (+ 2 (* (/ (* 2 t) (+ 1 t)) (/ (* 2 t) (+ 1 t)))))

prune16.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize36.0ms

Local error

Found 4 expressions with local error:

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

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
4 → 92
Calls

4 calls. Slowest were:

6.0ms
(/ (* t 2) (+ 1 t))
6.0ms
(/ (* t 2) (+ 1 t))
6.0ms
(/ (* t 2) (+ 1 t))

series74.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

23.0ms
(/ (* t 2) (+ 1 t))
19.0ms
(/ (* t 2) (+ 1 t))
17.0ms
(/ (* t 2) (+ 1 t))
15.0ms
(/ (* t 2) (+ 1 t))

simplify5.5s

Counts
64 → 104
Calls

64 calls. Slowest were:

693.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
613.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
570.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))

prune926.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample1.7s

Algorithm
intervals