Average Error: 1.0 → 0.0
Time: 11.6s
Precision: 64
Internal Precision: 128
\[2 \cdot \cos \left(\frac{2 \cdot \pi}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)\]
\[2 \cdot \left(\sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)} \cdot \sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right) \cdot \cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}\right)\]

Error

Bits error versus g

Bits error versus h

Derivation

  1. Initial program 1.0

    \[2 \cdot \cos \left(\frac{2 \cdot \pi}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)\]
  2. Simplified1.0

    \[\leadsto \color{blue}{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right) \cdot 2}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt1.0

    \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)} \cdot \sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}\right) \cdot \sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}\right)} \cdot 2\]
  5. Using strategy rm
  6. Applied cbrt-unprod0.0

    \[\leadsto \left(\color{blue}{\sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right) \cdot \cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}} \cdot \sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}\right) \cdot 2\]
  7. Final simplification0.0

    \[\leadsto 2 \cdot \left(\sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)} \cdot \sqrt[3]{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right) \cdot \cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}\right)\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (g h)
  :name "2-ancestry mixing, negative discriminant"
  (* 2 (cos (+ (/ (* 2 PI) 3) (/ (acos (/ (- g) h)) 3)))))

Details

Time bar (total: 11.0s)Debug log

sample153.0ms

Algorithm
intervals

simplify12.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

12.0ms
(* 2 (cos (+ (/ (* 2 PI) 3) (/ (acos (/ (- g) h)) 3))))

prune15.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 1.0b

localize43.0ms

Local error

Found 3 expressions with local error:

1.0b
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
0.9b
(/ (acos (/ (- g) h)) 3)
0.0b
(fma 2/3 PI (/ (acos (/ (- g) h)) 3))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
3 → 37
Calls

3 calls. Slowest were:

6.0ms
(/ (acos (/ (- g) h)) 3)
4.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
0.0ms
(fma 2/3 PI (/ (acos (/ (- g) h)) 3))

series132.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

95.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
30.0ms
(fma 2/3 PI (/ (acos (/ (- g) h)) 3))
7.0ms
(/ (acos (/ (- g) h)) 3)

simplify305.0ms

Counts
14 → 46
Calls

14 calls. Slowest were:

38.0ms
(+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI))
38.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))
36.0ms
(+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI))

prune501.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.9b

localize9.0ms

Local error

Found 4 expressions with local error:

1.0b
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
1.0b
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
0.9b
(/ (acos (/ (- g) h)) 3)
0.9b
(expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 49
Calls

4 calls. Slowest were:

3.0ms
(/ (acos (/ (- g) h)) 3)
2.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
0.0ms
(expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))

series402.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

154.0ms
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
126.0ms
(expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))
114.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
7.0ms
(/ (acos (/ (- g) h)) 3)

simplify341.0ms

Counts
19 → 61
Calls

19 calls. Slowest were:

39.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))
37.0ms
(- (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))) 1)
28.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))

prune836.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.9b

localize52.0ms

Local error

Found 4 expressions with local error:

1.0b
(* (cbrt (acos (/ (- g) h))) (cbrt (acos (/ (- g) h))))
1.0b
(cbrt (acos (/ (- g) h)))
1.0b
(cbrt (acos (/ (- g) h)))
1.0b
(cbrt (acos (/ (- g) h)))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 69
Calls

4 calls. Slowest were:

10.0ms
(* (cbrt (acos (/ (- g) h))) (cbrt (acos (/ (- g) h))))
1.0ms
(cbrt (acos (/ (- g) h)))
1.0ms
(cbrt (acos (/ (- g) h)))

series236.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

70.0ms
(* (cbrt (acos (/ (- g) h))) (cbrt (acos (/ (- g) h))))
68.0ms
(cbrt (acos (/ (- g) h)))
54.0ms
(cbrt (acos (/ (- g) h)))
43.0ms
(cbrt (acos (/ (- g) h)))

simplify292.0ms

Counts
41 → 81
Calls

41 calls. Slowest were:

27.0ms
(pow (acos (* -1 (/ g h))) 1/3)
25.0ms
(pow (acos (* -1 (/ g h))) 1/3)
23.0ms
(pow (acos (* -1 (/ g h))) 1/3)

prune1.2s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.9b

localize27.0ms

Local error

Found 4 expressions with local error:

1.0b
(* (cbrt (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))) (cbrt (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
1.0b
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
1.0b
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
1.0b
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

14.0ms
(* (cbrt (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))) (cbrt (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
4.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
3.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

series495.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

188.0ms
(* (cbrt (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))) (cbrt (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
116.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
104.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
87.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

simplify772.0ms

Counts
35 → 72
Calls

35 calls. Slowest were:

46.0ms
(pow (pow (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI))) 2) 1/3)
40.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))
40.0ms
(pow (pow (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI))) 2) 1/3)

prune873.0ms

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 0.0b

regimes281.0ms

Accuracy

0% (0.0b remaining)

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

bsearch4.0ms

end0.0ms

sample3.9s

Algorithm
intervals