Average Error: 0.0 → 0.0
Time: 1.4m
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 2019022 +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: 1.4m)Debug log

sample45.0ms

Algorithm
intervals
Results
31.0ms256×body80valid

simplify525.0ms

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

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

rewrite14.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
6.0ms
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))
6.0ms
(/ (* t 2) (+ 1 t))
0.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)
0.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)

series142.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
71.0ms
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))
33.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)
21.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)
16.0ms
(/ (* t 2) (+ 1 t))

simplify9.5s

Counts
50 → 84
Calls
50 calls:
Slowest
682.0ms
(- (+ (* 2 t) (* 2 (pow t 3))) (* 2 (pow t 2)))
470.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)))
407.0ms
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))
363.0ms
(/ (* (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))))
353.0ms
(/ (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)))

prune748.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize12.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))) (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))))
0.0b
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
0.0b
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)

rewrite15.0ms

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

series341.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
150.0ms
(/ (hypot 1 (/ (* t 2) (+ 1 t))) (/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))))
112.0ms
(/ (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2) (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
48.0ms
(hypot 1 (/ (* t 2) (+ 1 t)))
30.0ms
(fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)

simplify1.0m

Counts
219 → 181
Calls
219 calls:
Slowest
664.0ms
(/ 1 (/ (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (sqrt 1)))
607.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)) (sqrt 1)))
508.0ms
(/ 1 (/ (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 2))) (sqrt (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))))
434.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))) (sqrt (sqrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))))
433.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))) (sqrt (* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))))))

prune2.0s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize26.0ms

Local error

Found 4 expressions with local error:

0.5b
(* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
0.5b
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
0.5b
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
0.5b
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))

rewrite9.0ms

Algorithm
rewrite-expression-head
Rules
15×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
pow1
pow1/3
add-exp-log
associate-*l*
associate-*r*
add-log-exp
log1p-expm1-u
add-cbrt-cube
expm1-log1p-u
pow-prod-up
pow-prod-down
cbrt-unprod
*-commutative
prod-exp
pow-plus
pow2
Counts
4 → 69
Calls
4 calls:
Slowest
7.0ms
(* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
1.0ms
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
1.0ms
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
1.0ms
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))

series316.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
84.0ms
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
81.0ms
(* (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)) (cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1)))
81.0ms
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
70.0ms
(cbrt (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))

simplify8.6s

Counts
41 → 81
Calls
41 calls:
Slowest
642.0ms
(* (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
621.0ms
(* (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1) (fma (/ (* t 2) (+ 1 t)) (/ (* t 2) (+ 1 t)) 1))
351.0ms
(- (+ (pow 25 1/3) (* 296/225 (* (/ 1 (pow t 2)) (pow 25 1/3)))) (* 16/15 (* (/ 1 t) (pow 25 1/3))))
336.0ms
(- (+ (pow 25 1/3) (* 296/225 (* (/ 1 (pow t 2)) (pow 25 1/3)))) (* 16/15 (* (/ 1 t) (pow 25 1/3))))
286.0ms
(- (+ (* 116/225 (* (/ 1 (pow t 2)) (pow 5 1/3))) (pow 5 1/3)) (* 8/15 (* (/ 1 t) (pow 5 1/3))))

prune659.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes23.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample947.0ms

Algorithm
intervals
Results
854.0ms8000×body80valid