Average Error: 45.7 → 0.0
Time: 5.7s
Precision: 64
Internal Precision: 128
\[\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1.0}\]
\[\begin{array}{l} \mathbf{if}\;i \le 218.10975117139895:\\ \;\;\;\;\frac{i}{(16 \cdot \left(i \cdot i\right) + \left(-4 \cdot 1.0\right))_*} \cdot i\\ \mathbf{else}:\\ \;\;\;\;\frac{0.00390625}{{i}^{4}} + (\left(\frac{0.015625}{i}\right) \cdot \left(\frac{1}{i}\right) + \frac{1}{16})_*\\ \end{array}\]

Error

Bits error versus i

Derivation

  1. Split input into 2 regimes
  2. if i < 218.10975117139895

    1. Initial program 43.9

      \[\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1.0}\]
    2. Simplified0.0

      \[\leadsto \color{blue}{\frac{i \cdot \frac{i}{4}}{(\left(i \cdot 4\right) \cdot i + \left(-1.0\right))_*}}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity0.0

      \[\leadsto \frac{i \cdot \frac{i}{4}}{\color{blue}{1 \cdot (\left(i \cdot 4\right) \cdot i + \left(-1.0\right))_*}}\]
    5. Applied times-frac0.0

      \[\leadsto \color{blue}{\frac{i}{1} \cdot \frac{\frac{i}{4}}{(\left(i \cdot 4\right) \cdot i + \left(-1.0\right))_*}}\]
    6. Simplified0.0

      \[\leadsto \color{blue}{i} \cdot \frac{\frac{i}{4}}{(\left(i \cdot 4\right) \cdot i + \left(-1.0\right))_*}\]
    7. Simplified0.0

      \[\leadsto i \cdot \color{blue}{\frac{i}{(16 \cdot \left(i \cdot i\right) + \left(-4 \cdot 1.0\right))_*}}\]

    if 218.10975117139895 < i

    1. Initial program 47.4

      \[\frac{\frac{\left(i \cdot i\right) \cdot \left(i \cdot i\right)}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right)}}{\left(2 \cdot i\right) \cdot \left(2 \cdot i\right) - 1.0}\]
    2. Simplified31.5

      \[\leadsto \color{blue}{\frac{i \cdot \frac{i}{4}}{(\left(i \cdot 4\right) \cdot i + \left(-1.0\right))_*}}\]
    3. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{0.015625 \cdot \frac{1}{{i}^{2}} + \left(\frac{1}{16} + 0.00390625 \cdot \frac{1}{{i}^{4}}\right)}\]
    4. Simplified0.0

      \[\leadsto \color{blue}{(\left(\frac{0.015625}{i}\right) \cdot \left(\frac{1}{i}\right) + \frac{1}{16})_* + \frac{0.00390625}{{i}^{4}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \le 218.10975117139895:\\ \;\;\;\;\frac{i}{(16 \cdot \left(i \cdot i\right) + \left(-4 \cdot 1.0\right))_*} \cdot i\\ \mathbf{else}:\\ \;\;\;\;\frac{0.00390625}{{i}^{4}} + (\left(\frac{0.015625}{i}\right) \cdot \left(\frac{1}{i}\right) + \frac{1}{16})_*\\ \end{array}\]

Reproduce

herbie shell --seed 2019004 +o rules:numerics
(FPCore (i)
  :name "Octave 3.8, jcobi/4, as called"
  :pre (and (> i 0))
  (/ (/ (* (* i i) (* i i)) (* (* 2 i) (* 2 i))) (- (* (* 2 i) (* 2 i)) 1.0)))

Details

Time bar (total: 5.0s)Debug log

sample29.0ms

Algorithm
intervals

simplify171.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

170.0ms
(/ (/ (* (* i i) (* i i)) (* (* 2 i) (* 2 i))) (- (* (* 2 i) (* 2 i)) 1.0))

prune16.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 14.5b

localize31.0ms

Local error

Found 1 expressions with local error:

14.5b
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 22
Calls

1 calls. Slowest were:

4.0ms
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

series53.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

53.0ms
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

simplify638.0ms

Counts
15 → 25
Calls

15 calls. Slowest were:

166.0ms
(- (+ (* 0.25 (pow i 2)) (+ (* 1.0 (pow i 4)) (* 4.0 (pow i 6)))))
105.0ms
(/ (* (* (* i (/ i 4)) (* i (/ i 4))) (* i (/ i 4))) (* (* (fma (* i 4) i (- 1.0)) (fma (* i 4) i (- 1.0))) (fma (* i 4) i (- 1.0))))
98.0ms
(- (log (* i (/ i 4))) (log (fma (* i 4) i (- 1.0))))

prune197.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize15.0ms

Local error

Found 2 expressions with local error:

13.9b
(/ i (fma 16 (* i i) (* -4 1.0)))
0.1b
(* i (/ i (fma 16 (* i i) (* -4 1.0))))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
2 → 30
Calls

2 calls. Slowest were:

1.0ms
(* i (/ i (fma 16 (* i i) (* -4 1.0))))
1.0ms
(/ i (fma 16 (* i i) (* -4 1.0)))

series70.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

39.0ms
(/ i (fma 16 (* i i) (* -4 1.0)))
31.0ms
(* i (/ i (fma 16 (* i i) (* -4 1.0))))

simplify1.1s

Counts
14 → 36
Calls

14 calls. Slowest were:

348.0ms
(- (+ (* 0.25 i) (+ (* 1.0 (pow i 3)) (* 4.0 (pow i 5)))))
203.0ms
(- (+ (* 0.25 (pow i 2)) (+ (* 1.0 (pow i 4)) (* 4.0 (pow i 6)))))
170.0ms
(+ (* 0.00390625 (/ 1 (pow i 5))) (+ (* 0.015625 (/ 1 (pow i 3))) (* 1/16 (/ 1 i))))

prune279.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize18.0ms

Local error

Found 3 expressions with local error:

0.3b
(/ 0.00390625 (pow i 4))
0.1b
(fma (/ 0.015625 i) (/ 1 i) 1/16)
0.0b
(+ (fma (/ 0.015625 i) (/ 1 i) 1/16) (/ 0.00390625 (pow i 4)))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
3 → 43
Calls

3 calls. Slowest were:

4.0ms
(+ (fma (/ 0.015625 i) (/ 1 i) 1/16) (/ 0.00390625 (pow i 4)))
1.0ms
(/ 0.00390625 (pow i 4))
0.0ms
(fma (/ 0.015625 i) (/ 1 i) 1/16)

series83.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

48.0ms
(fma (/ 0.015625 i) (/ 1 i) 1/16)
18.0ms
(+ (fma (/ 0.015625 i) (/ 1 i) 1/16) (/ 0.00390625 (pow i 4)))
17.0ms
(/ 0.00390625 (pow i 4))

simplify473.0ms

Counts
17 → 52
Calls

17 calls. Slowest were:

74.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
72.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
65.0ms
(* (exp (fma (/ 0.015625 i) (/ 1 i) 1/16)) (exp (/ 0.00390625 (pow i 4))))

prune520.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes25.0ms

Accuracy

100% (0.0b remaining)

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

bsearch82.0ms

end0.0ms

sample1.3s

Algorithm
intervals