Average Error: 45.8 → 0.0
Time: 10.0s
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 227.34436273801197:\\ \;\;\;\;\frac{\frac{i}{4} \cdot i}{(\left(4 \cdot i\right) \cdot i + \left(-1.0\right))_*}\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{0.015625}{i}\right) \cdot \left(\frac{1}{i}\right) + \frac{1}{16})_* + \frac{0.00390625}{{i}^{4}}\\ \end{array}\]

Error

Bits error versus i

Derivation

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

    1. Initial program 45.2

      \[\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))_*}}\]

    if 227.34436273801197 < i

    1. Initial program 46.3

      \[\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. Simplified30.9

      \[\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 227.34436273801197:\\ \;\;\;\;\frac{\frac{i}{4} \cdot i}{(\left(4 \cdot i\right) \cdot i + \left(-1.0\right))_*}\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{0.015625}{i}\right) \cdot \left(\frac{1}{i}\right) + \frac{1}{16})_* + \frac{0.00390625}{{i}^{4}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019016 +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: 9.6s)Debug log

sample70.0ms

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

simplify136.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
136.0ms
(/ (/ (* (* i i) (* i i)) (* (* 2 i) (* 2 i))) (- (* (* 2 i) (* 2 i)) 1.0))

prune20.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 12.8b

localize30.0ms

Local error

Found 1 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
add-exp-log
add-cbrt-cube
times-frac
*-un-lft-identity
associate-/r*
add-sqr-sqrt
associate-/l/
add-log-exp
associate-/l*
div-inv
log1p-expm1-u
associate-*r/
div-exp
frac-2neg
clear-num
cbrt-undiv
pow1
expm1-log1p-u
Counts
1 → 22
Calls
1 calls:
Slowest
7.0ms
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

series48.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
47.0ms
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

simplify737.0ms

Counts
15 → 25
Calls
15 calls:
Slowest
214.0ms
(- (+ (* 0.25 (pow i 2)) (+ (* 1.0 (pow i 4)) (* 4.0 (pow i 6)))))
161.0ms
(- (log (* i (/ i 4))) (log (fma (* i 4) i (- 1.0))))
110.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))))
76.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)))))

prune204.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

18.2b
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
18.2b
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
18.2b
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
12.8b
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

rewrite16.0ms

Algorithm
rewrite-expression-head
Rules
21×cbrt-prod
12×add-cube-cbrt
12×times-frac
12×*-un-lft-identity
12×add-sqr-sqrt
add-exp-log
add-cbrt-cube
add-log-exp
div-inv
log1p-expm1-u
pow1
expm1-log1p-u
pow1/3
associate-/r*
cbrt-div
associate-/l/
associate-/l*
associate-*r/
div-exp
frac-2neg
clear-num
cbrt-undiv
Counts
4 → 76
Calls
4 calls:
Slowest
8.0ms
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))
3.0ms
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
2.0ms
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
2.0ms
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))

series692.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
227.0ms
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
217.0ms
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
213.0ms
(cbrt (/ (* i (/ i 4)) (fma (* i 4) i (- 1.0))))
35.0ms
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

simplify4.1s

Counts
48 → 88
Calls
48 calls:
Slowest
500.0ms
(+ (* (cbrt 1/4) (pow 1/4 1/3)) (+ (* 0.013888888888888888 (* (/ (cbrt 1/4) (pow i 4)) (pow 1/4 1/3))) (* 0.08333333333333333 (* (/ (cbrt 1/4) (pow i 2)) (pow 1/4 1/3)))))
431.0ms
(+ (* (cbrt 1/4) (pow 1/4 1/3)) (+ (* 0.013888888888888888 (* (/ (cbrt 1/4) (pow i 4)) (pow 1/4 1/3))) (* 0.08333333333333333 (* (/ (cbrt 1/4) (pow i 2)) (pow 1/4 1/3)))))
372.0ms
(+ (* (cbrt 1/4) (pow 1/4 1/3)) (+ (* 0.013888888888888888 (* (/ (cbrt 1/4) (pow i 4)) (pow 1/4 1/3))) (* 0.08333333333333333 (* (/ (cbrt 1/4) (pow i 2)) (pow 1/4 1/3)))))
343.0ms
(+ (* (cbrt 1/4) (pow 1/4 1/3)) (+ (* 0.013888888888888888 (* (/ (cbrt 1/4) (pow i 4)) (pow 1/4 1/3))) (* 0.08333333333333333 (* (/ (cbrt 1/4) (pow i 2)) (pow 1/4 1/3)))))
283.0ms
(+ (* (cbrt 1/4) (pow 1/4 1/3)) (+ (* 0.013888888888888888 (* (/ (cbrt 1/4) (pow i 4)) (pow 1/4 1/3))) (* 0.08333333333333333 (* (/ (cbrt 1/4) (pow i 2)) (pow 1/4 1/3)))))

prune890.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize17.0ms

Local error

Found 3 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Rules
*-un-lft-identity
add-log-exp
add-cube-cbrt
add-sqr-sqrt
log1p-expm1-u
add-exp-log
add-cbrt-cube
fma-def
associate-/r*
pow1
expm1-log1p-u
fma-udef
distribute-lft-out
div-inv
flip-+
flip3-+
frac-2neg
sum-log
clear-num
associate-+l+
+-commutative
Counts
3 → 43
Calls
3 calls:
Slowest
4.0ms
(+ (fma (/ 0.015625 i) (/ 1 i) 1/16) (/ 0.00390625 (pow i 4)))
0.0ms
(/ 0.00390625 (pow i 4))
0.0ms
(fma (/ 0.015625 i) (/ 1 i) 1/16)

series103.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
45.0ms
(fma (/ 0.015625 i) (/ 1 i) 1/16)
31.0ms
(+ (fma (/ 0.015625 i) (/ 1 i) 1/16) (/ 0.00390625 (pow i 4)))
26.0ms
(/ 0.00390625 (pow i 4))

simplify480.0ms

Counts
17 → 52
Calls
17 calls:
Slowest
105.0ms
(* (exp (fma (/ 0.015625 i) (/ 1 i) 1/16)) (exp (/ 0.00390625 (pow i 4))))
72.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
65.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
49.0ms
(* (cbrt (fma (/ 0.015625 i) (/ 1 i) 1/16)) (cbrt (fma (/ 0.015625 i) (/ 1 i) 1/16)))
41.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))

prune473.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes29.0ms

Accuracy

100% (0.0b remaining)

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

bsearch63.0ms

end0.0ms

sample1.4s

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