Average Error: 0.0 → 0.0
Time: 8.9s
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 2019010 +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: 8.6s)Debug log

sample50.0ms

Algorithm
intervals

simplify563.0ms

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

prune15.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize20.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))

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
12×add-cube-cbrt
12×add-exp-log
12×add-cbrt-cube
12×times-frac
12×*-un-lft-identity
12×associate-/r*
12×add-sqr-sqrt
associate-/r/
add-log-exp
associate-/l*
div-inv
log1p-expm1-u
flip-+
div-exp
flip3-+
frac-2neg
clear-num
cbrt-undiv
pow1
expm1-log1p-u
Counts
4 → 92
Calls
4 calls:
Slowest
3.0ms
(/ (* t 2) (+ 1 t))
3.0ms
(/ (* t 2) (+ 1 t))
3.0ms
(/ (* t 2) (+ 1 t))
3.0ms
(/ (* t 2) (+ 1 t))

series53.0ms

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

simplify5.5s

Counts
64 → 104
Calls
64 calls:
Slowest
709.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
676.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
612.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
565.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
336.0ms
(- (+ (* 2 (/ 1 (pow t 2))) 2) (* 2 (/ 1 t)))

prune934.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0.0b

end0.0ms

sample1.4s

Algorithm
intervals