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

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-cbrt-cube1.5

    \[\leadsto \color{blue}{\sqrt[3]{\left(\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) \cdot \cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}} \cdot 2\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.0

    \[\leadsto \sqrt[3]{\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 \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) \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)} \cdot \cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)} \cdot 2\]
  7. Final simplification0.0

    \[\leadsto \sqrt[3]{\left(\left(\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) \cdot \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) \cdot \cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(-\frac{g}{h}\right)}{3}\right))_*\right)}\right) \cdot \cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(-\frac{g}{h}\right)}{3}\right))_*\right)} \cdot 2\]

Reproduce

herbie shell --seed 2019005 +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.4s)Debug log

sample165.0ms

Algorithm
intervals

simplify27.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune33.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 1.0b

localize21.0ms

Local error

Found 3 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
3 → 37
Calls

3 calls. Slowest were:

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

series173.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

123.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
38.0ms
(fma 2/3 PI (/ (acos (/ (- g) h)) 3))
12.0ms
(/ (acos (/ (- g) h)) 3)

simplify277.0ms

Counts
14 → 46
Calls

14 calls. Slowest were:

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

prune525.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 1.0b

localize12.0ms

Local error

Found 4 expressions with local error:

1.0b
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
1.0b
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
1.0b
(expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))
1.0b
(/ (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))))

series380.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

143.0ms
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
134.0ms
(expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))
91.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
11.0ms
(/ (acos (/ (- g) h)) 3)

simplify459.0ms

Counts
19 → 61
Calls

19 calls. Slowest were:

59.0ms
(- (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))) 1)
51.0ms
(- (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))) 1)
41.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))

prune750.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 1.0b

localize28.0ms

Local error

Found 4 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 43
Calls

4 calls. Slowest were:

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

series629.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

193.0ms
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
164.0ms
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
151.0ms
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
120.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

simplify483.0ms

Counts
16 → 55
Calls

16 calls. Slowest were:

43.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))
43.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))
41.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))

prune905.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 1.0b

localize12.0ms

Local error

Found 4 expressions with local error:

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)))
1.0b
(* (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))) (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
4 → 54
Calls

4 calls. Slowest were:

17.0ms
(* (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))) (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))
3.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
3.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

series401.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

117.0ms
(* (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))) (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))
98.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
94.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
91.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

simplify760.0ms

Counts
28 → 66
Calls

28 calls. Slowest were:

59.0ms
(* (* (* (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))) (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))) (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))) (* (* (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))) (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))) (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
52.0ms
(* 1/2 (cos (* 2 (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
48.0ms
(+ (cos (+ (fma 2/3 PI (/ (acos (/ (- g) h)) 3)) (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))) (cos (- (fma 2/3 PI (/ (acos (/ (- g) h)) 3)) (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))

prune848.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

regimes189.0ms

Accuracy

0% (0.0b remaining)

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

bsearch3.0ms

end0.0ms

sample4.3s

Algorithm
intervals