Average Error: 0.5 → 0.6
Time: 1.3m
Precision: 64
Internal Precision: 128
\[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
\[\cos^{-1} \left(\frac{\sqrt{(\left(v \cdot v\right) \cdot -5 + 1)_*}}{(v \cdot v + -1)_*} \cdot \sqrt{(\left(v \cdot v\right) \cdot -5 + 1)_*}\right)\]

Error

Bits error versus v

Derivation

  1. Initial program 0.5

    \[\cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{v \cdot v - 1}\right)\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.5

    \[\leadsto \cos^{-1} \left(\frac{1 - 5 \cdot \left(v \cdot v\right)}{\color{blue}{1 \cdot \left(v \cdot v - 1\right)}}\right)\]
  4. Applied add-sqr-sqrt0.6

    \[\leadsto \cos^{-1} \left(\frac{\color{blue}{\sqrt{1 - 5 \cdot \left(v \cdot v\right)} \cdot \sqrt{1 - 5 \cdot \left(v \cdot v\right)}}}{1 \cdot \left(v \cdot v - 1\right)}\right)\]
  5. Applied times-frac0.6

    \[\leadsto \cos^{-1} \color{blue}{\left(\frac{\sqrt{1 - 5 \cdot \left(v \cdot v\right)}}{1} \cdot \frac{\sqrt{1 - 5 \cdot \left(v \cdot v\right)}}{v \cdot v - 1}\right)}\]
  6. Simplified0.6

    \[\leadsto \cos^{-1} \left(\color{blue}{\sqrt{(\left(v \cdot v\right) \cdot -5 + 1)_*}} \cdot \frac{\sqrt{1 - 5 \cdot \left(v \cdot v\right)}}{v \cdot v - 1}\right)\]
  7. Simplified0.6

    \[\leadsto \cos^{-1} \left(\sqrt{(\left(v \cdot v\right) \cdot -5 + 1)_*} \cdot \color{blue}{\frac{\sqrt{(\left(v \cdot v\right) \cdot -5 + 1)_*}}{(v \cdot v + -1)_*}}\right)\]
  8. Final simplification0.6

    \[\leadsto \cos^{-1} \left(\frac{\sqrt{(\left(v \cdot v\right) \cdot -5 + 1)_*}}{(v \cdot v + -1)_*} \cdot \sqrt{(\left(v \cdot v\right) \cdot -5 + 1)_*}\right)\]

Reproduce

herbie shell --seed 2019004 +o rules:numerics
(FPCore (v)
  :name "Falkner and Boettcher, Appendix B, 1"
  (acos (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))

Details

Time bar (total: 1.3m)Debug log

sample248.0ms

Algorithm
intervals

simplify574.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

573.0ms
(acos (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))

prune16.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.4b

localize33.0ms

Local error

Found 4 expressions with local error:

0.4b
(acos (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))
0.2b
(* 5 (* v v))
0.0b
(/ (- 1 (* 5 (* v v))) (- (* v v) 1))
0.0b
(- 1 (* 5 (* v v)))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 72
Calls

4 calls. Slowest were:

6.0ms
(/ (- 1 (* 5 (* v v))) (- (* v v) 1))
2.0ms
(* 5 (* v v))
2.0ms
(acos (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))

series88.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

39.0ms
(- 1 (* 5 (* v v)))
29.0ms
(/ (- 1 (* 5 (* v v))) (- (* v v) 1))
11.0ms
(* 5 (* v v))
7.0ms
(acos (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))

simplify6.3s

Counts
49 → 84
Calls

49 calls. Slowest were:

859.0ms
(/ (* (* (- 1 (* 5 (* v v))) (- 1 (* 5 (* v v)))) (- 1 (* 5 (* v v)))) (* (* (- (* v v) 1) (- (* v v) 1)) (- (* v v) 1)))
568.0ms
(/ (- 1 (* 5 (* v v))) (- (* v v) 1))
546.0ms
(- (+ (* 4 (/ 1 (pow v 4))) (+ 5 (* 4 (/ 1 (pow v 2))))))

prune697.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.4b

localize18.0ms

Local error

Found 4 expressions with local error:

0.5b
(asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))
0.2b
(* 5 (* v v))
0.0b
(- (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))
0.0b
(/ (- 1 (* 5 (* v v))) (- (* v v) 1))

rewrite38.0ms

Algorithm
rewrite-expression-head
Counts
4 → 92
Calls

4 calls. Slowest were:

23.0ms
(- (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))
10.0ms
(/ (- 1 (* 5 (* v v))) (- (* v v) 1))
2.0ms
(* 5 (* v v))

series90.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

41.0ms
(- (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))
24.0ms
(/ (- 1 (* 5 (* v v))) (- (* v v) 1))
19.0ms
(* 5 (* v v))
6.0ms
(asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))

simplify22.6s

Counts
80 → 104
Calls

80 calls. Slowest were:

844.0ms
(/ (* (* (- 1 (* 5 (* v v))) (- 1 (* 5 (* v v)))) (- 1 (* 5 (* v v)))) (* (* (- (* v v) 1) (- (* v v) 1)) (- (* v v) 1)))
811.0ms
(fma 1 (/ PI 2) (- (* (sqrt (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (sqrt (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))))))
647.0ms
(fma 1 (/ PI 2) (- (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) 1)))

prune1.0s

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.4b

localize36.0ms

Local error

Found 4 expressions with local error:

2.2b
(+ (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (* (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))))
1.0b
(pow (/ PI 2) 3)
1.0b
(pow (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) 3)
1.0b
(/ (- (pow (/ PI 2) 3) (pow (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) 3)) (+ (* (/ PI 2) (/ PI 2)) (+ (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (* (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))))))

rewrite72.0ms

Algorithm
rewrite-expression-head
Counts
4 → 160
Calls

4 calls. Slowest were:

48.0ms
(/ (- (pow (/ PI 2) 3) (pow (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) 3)) (+ (* (/ PI 2) (/ PI 2)) (+ (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (* (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))))))
13.0ms
(+ (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (* (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))))
3.0ms
(pow (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) 3)

series536.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

445.0ms
(/ (- (pow (/ PI 2) 3) (pow (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) 3)) (+ (* (/ PI 2) (/ PI 2)) (+ (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (* (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))))))
49.0ms
(+ (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (* (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))))
42.0ms
(pow (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) 3)
0.0ms
(pow (/ PI 2) 3)

simplify32.4s

Counts
174 → 170
Calls

174 calls. Slowest were:

607.0ms
(pow (* (cbrt (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) (cbrt (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))) 3)
595.0ms
(/ (+ (pow (sqrt (/ PI 2)) 3) (pow (sqrt (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1)))) 3)) 1)
589.0ms
(* (exp (* (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))) (exp (* (/ PI 2) (asin (/ (- 1 (* 5 (* v v))) (- (* v v) 1))))))

prune2.0s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.4b

localize23.0ms

Local error

Found 4 expressions with local error:

0.4b
(acos (* (sqrt (fma (* v v) -5 1)) (/ (sqrt (fma (* v v) -5 1)) (fma v v -1))))
0.0b
(* (sqrt (fma (* v v) -5 1)) (/ (sqrt (fma (* v v) -5 1)) (fma v v -1)))
0.0b
(/ (sqrt (fma (* v v) -5 1)) (fma v v -1))
0.0b
(sqrt (fma (* v v) -5 1))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 109
Calls

4 calls. Slowest were:

7.0ms
(* (sqrt (fma (* v v) -5 1)) (/ (sqrt (fma (* v v) -5 1)) (fma v v -1)))
4.0ms
(/ (sqrt (fma (* v v) -5 1)) (fma v v -1))
1.0ms
(acos (* (sqrt (fma (* v v) -5 1)) (/ (sqrt (fma (* v v) -5 1)) (fma v v -1))))

series105.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

54.0ms
(/ (sqrt (fma (* v v) -5 1)) (fma v v -1))
25.0ms
(* (sqrt (fma (* v v) -5 1)) (/ (sqrt (fma (* v v) -5 1)) (fma v v -1)))
23.0ms
(sqrt (fma (* v v) -5 1))
3.0ms
(acos (* (sqrt (fma (* v v) -5 1)) (/ (sqrt (fma (* v v) -5 1)) (fma v v -1))))

simplify5.5s

Counts
95 → 121
Calls

95 calls. Slowest were:

433.0ms
(- (+ (/ (sqrt -5) (pow v 3)) (+ (/ (sqrt -5) v) (+ (* 1/2 (/ 1 (* (sqrt -5) (pow v 3)))) (+ (/ (sqrt -5) (pow v 5)) (* 1/2 (/ 1 (* (sqrt -5) (pow v 5)))))))) (* 1/8 (/ 1 (* (pow (sqrt -5) 3) (pow v 5)))))
360.0ms
(- (+ (* 4 (/ 1 (pow v 4))) (+ 5 (* 4 (/ 1 (pow v 2))))))
357.0ms
(- (+ (* 4 (/ 1 (pow v 4))) (+ 5 (* 4 (/ 1 (pow v 2))))))

prune866.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.4b

regimes222.0ms

Accuracy

0% (0.1b remaining)

Error of 0.6b against oracle of 0.5b and baseline of 0.6b

bsearch1.0ms

end0.0ms

sample5.8s

Algorithm
intervals