Average Error: 0.0 → 0.0
Time: 52.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 2019016 +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: 52.1s)Debug log

sample27.0ms

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

simplify525.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
525.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: 0.0b

localize38.0ms

Local error

Found 4 expressions with local error:

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

rewrite23.0ms

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

series169.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
76.0ms
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))
37.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
36.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)
19.0ms
(/ (* t 2) (+ 1 t))

simplify9.8s

Counts
50 → 84
Calls
50 calls:
Slowest
688.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
424.0ms
(/ (* (* (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (* (* (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
390.0ms
(- (log (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (log (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
369.0ms
(/ (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
365.0ms
(/ (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))))

prune750.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0b

localize8.0ms

Local error

Found 4 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Rules
19×add-cube-cbrt
19×*-un-lft-identity
19×add-sqr-sqrt
18×times-frac
16×associate-/r*
add-exp-log
add-cbrt-cube
pow1
add-log-exp
log1p-expm1-u
expm1-log1p-u
associate-/l*
div-inv
fma-udef
div-exp
frac-2neg
clear-num
rec-exp
inv-pow
pow-flip
associate-/r/
cbrt-undiv
Counts
4 → 79
Calls
4 calls:
Slowest
3.0ms
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
2.0ms
(/ 1 (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
0.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
0.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)

series177.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
67.0ms
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
52.0ms
(/ 1 (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
35.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)
22.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)

simplify12.4s

Counts
52 → 91
Calls
52 calls:
Slowest
385.0ms
(/ (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))) (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))))
376.0ms
(/ (* (* (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (* (* (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
360.0ms
(/ (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
358.0ms
(/ (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
342.0ms
(cbrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))

prune961.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

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

rewrite7.0ms

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

series196.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
93.0ms
(/ (hypot 1 (/ (* t 2) (+ 1 t))) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))
43.0ms
(hypot 1 (/ (* t 2) (+ 1 t)))
39.0ms
(hypot 1 (/ (* t 2) (+ 1 t)))
21.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)

simplify7.9s

Counts
37 → 71
Calls
37 calls:
Slowest
679.0ms
(/ (hypot 1 (/ (* t 2) (+ 1 t))) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))
397.0ms
(/ (* (cbrt (hypot 1 (/ (* t 2) (+ 1 t)))) (cbrt (hypot 1 (/ (* t 2) (+ 1 t))))) (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
359.0ms
(/ (sqrt (hypot 1 (/ (* t 2) (+ 1 t)))) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
343.0ms
(/ 1 (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
343.0ms
(/ (* (cbrt (hypot 1 (/ (* t 2) (+ 1 t)))) (cbrt (hypot 1 (/ (* t 2) (+ 1 t))))) (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))))

prune857.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

0.5b
(* (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))) (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))))
0.0b
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
0.0b
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
0.0b
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)

rewrite16.0ms

Algorithm
rewrite-expression-head
Rules
26×sqrt-prod
20×add-cube-cbrt
20×*-un-lft-identity
20×add-sqr-sqrt
18×times-frac
16×associate-*l*
16×associate-*r*
pow1
add-exp-log
add-cbrt-cube
add-log-exp
log1p-expm1-u
sqrt-div
pow1/2
expm1-log1p-u
fma-udef
div-inv
pow-prod-up
pow-prod-down
cbrt-unprod
*-commutative
associate-*r/
prod-exp
associate-*l/
sqrt-unprod
pow-plus
rem-square-sqrt
frac-times
pow2
Counts
4 → 85
Calls
4 calls:
Slowest
14.0ms
(* (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))) (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))))
0.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
0.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
0.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)

series156.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
74.0ms
(* (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))) (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))))
36.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)
24.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
21.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)

simplify15.6s

Counts
59 → 97
Calls
59 calls:
Slowest
1.0s
(* (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
863.0ms
(* (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
633.0ms
(* (* (* (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))) (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))) (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))) (* (* (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))) (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))) (sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))))
381.0ms
(sqrt (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
378.0ms
(sqrt (/ (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))) (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))))

prune1.2s

Pruning

4 alts after pruning (0 fresh and 4 done)

Merged error: 0b

regimes27.0ms

Accuracy

0% (0.0b remaining)

Error of 0.0b against oracle of 0.0b and baseline of 0.0b

bsearch1.0ms

end0.0ms

sample1.1s

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