Average Error: 45.3 → 0.0
Time: 7.3s
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.50852513912608:\\ \;\;\;\;\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.50852513912608

    1. Initial program 44.1

      \[\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.50852513912608 < i

    1. Initial program 46.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. Using strategy rm
    4. Applied *-un-lft-identity31.5

      \[\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-frac31.7

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

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

      \[\leadsto i \cdot \color{blue}{\frac{i}{(16 \cdot \left(i \cdot i\right) + \left(-4 \cdot 1.0\right))_*}}\]
    8. Using strategy rm
    9. Applied div-inv31.7

      \[\leadsto i \cdot \color{blue}{\left(i \cdot \frac{1}{(16 \cdot \left(i \cdot i\right) + \left(-4 \cdot 1.0\right))_*}\right)}\]
    10. Applied associate-*r*31.6

      \[\leadsto \color{blue}{\left(i \cdot i\right) \cdot \frac{1}{(16 \cdot \left(i \cdot i\right) + \left(-4 \cdot 1.0\right))_*}}\]
    11. 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)}\]
    12. 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.50852513912608:\\ \;\;\;\;\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 2019022 +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: 6.9s)Debug log

sample35.0ms

Algorithm
intervals
Results
22.0ms256×body80valid
4.0ms256×pre80true

simplify146.0ms

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

prune14.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 12.2b

localize18.0ms

Local error

Found 1 expressions with local error:

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

rewrite6.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
5.0ms
(/ (* i (/ i 4)) (fma (* i 4) i (- 1.0)))

series42.0ms

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

simplify537.0ms

Counts
15 → 25
Calls
15 calls:
Slowest
155.0ms
(- (+ (* 0.25 (pow i 2)) (+ (* 1.0 (pow i 4)) (* 4.0 (pow i 6)))))
94.0ms
(- (log (* i (/ i 4))) (log (fma (* i 4) i (- 1.0))))
67.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
63.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))))
40.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))

prune165.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0b

localize27.0ms

Local error

Found 3 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
associate-*r*
add-log-exp
log1p-expm1-u
add-exp-log
add-cbrt-cube
associate-/r*
pow1
expm1-log1p-u
div-inv
fma-udef
*-commutative
associate-*r/
frac-2neg
clear-num
Counts
3 → 40
Calls
3 calls:
Slowest
2.0ms
(* i (/ i (fma 16 (* i i) (* -4 1.0))))
1.0ms
(/ i (fma 16 (* i i) (* -4 1.0)))
0.0ms
(fma 16 (* i i) (* -4 1.0))

series104.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
47.0ms
(/ i (fma 16 (* i i) (* -4 1.0)))
32.0ms
(fma 16 (* i i) (* -4 1.0))
25.0ms
(* i (/ i (fma 16 (* i i) (* -4 1.0))))

simplify966.0ms

Counts
17 → 49
Calls
17 calls:
Slowest
262.0ms
(- (+ (* 0.25 i) (+ (* 1.0 (pow i 3)) (* 4.0 (pow i 5)))))
201.0ms
(- (+ (* 0.25 (pow i 2)) (+ (* 1.0 (pow i 4)) (* 4.0 (pow i 6)))))
144.0ms
(+ (* 0.00390625 (/ 1 (pow i 5))) (+ (* 0.015625 (/ 1 (pow i 3))) (* 1/16 (/ 1 i))))
112.0ms
(+ (* 0.00390625 (/ 1 (pow i 5))) (+ (* 0.015625 (/ 1 (pow i 3))) (* 1/16 (/ 1 i))))
39.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))

prune433.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize12.0ms

Local error

Found 3 expressions with local error:

12.3b
(* (* i i) (/ 1 (fma 16 (* i i) (* -4 1.0))))
0.4b
(/ 1 (fma 16 (* i i) (* -4 1.0)))
0.0b
(fma 16 (* i i) (* -4 1.0))

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
add-exp-log
pow1
add-cube-cbrt
add-cbrt-cube
*-un-lft-identity
add-sqr-sqrt
associate-*r*
add-log-exp
log1p-expm1-u
associate-/r*
expm1-log1p-u
div-inv
prod-exp
rec-exp
inv-pow
pow-flip
fma-udef
cbrt-unprod
*-commutative
un-div-inv
associate-*r/
pow-prod-down
associate-*l*
frac-2neg
clear-num
Counts
3 → 49
Calls
3 calls:
Slowest
8.0ms
(* (* i i) (/ 1 (fma 16 (* i i) (* -4 1.0))))
1.0ms
(/ 1 (fma 16 (* i i) (* -4 1.0)))
0.0ms
(fma 16 (* i i) (* -4 1.0))

series109.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
45.0ms
(* (* i i) (/ 1 (fma 16 (* i i) (* -4 1.0))))
35.0ms
(fma 16 (* i i) (* -4 1.0))
29.0ms
(/ 1 (fma 16 (* i i) (* -4 1.0)))

simplify1.2s

Counts
23 → 58
Calls
23 calls:
Slowest
300.0ms
(* (* (* (* i i) (* i i)) (* i i)) (* (* (/ 1 (fma 16 (* i i) (* -4 1.0))) (/ 1 (fma 16 (* i i) (* -4 1.0)))) (/ 1 (fma 16 (* i i) (* -4 1.0)))))
188.0ms
(- (+ (* 0.25 (pow i 2)) (+ (* 1.0 (pow i 4)) (* 4.0 (pow i 6)))))
126.0ms
(- (+ (* 1.0 (pow i 2)) (+ (* 4.0 (pow i 4)) 0.25)))
77.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
74.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))

prune525.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize25.0ms

Local error

Found 3 expressions with local error:

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

rewrite14.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
11.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)

series79.0ms

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

simplify502.0ms

Counts
17 → 52
Calls
17 calls:
Slowest
103.0ms
(* (exp (fma (/ 0.015625 i) (/ 1 i) 1/16)) (exp (/ 0.00390625 (pow i 4))))
57.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
53.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))
52.0ms
(* (cbrt (fma (/ 0.015625 i) (/ 1 i) 1/16)) (cbrt (fma (/ 0.015625 i) (/ 1 i) 1/16)))
47.0ms
(+ (* 0.015625 (/ 1 (pow i 2))) (+ 1/16 (* 0.00390625 (/ 1 (pow i 4)))))

prune458.0ms

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes45.0ms

Accuracy

100% (0.0b remaining)

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

bsearch70.0ms

end0.0ms

sample1.3s

Algorithm
intervals
Results
1.1s8000×body80valid
188.0ms8000×pre80true