Average Error: 1.0 → 0.1
Time: 17.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)\]
\[\log \left(\left(\sqrt[3]{e^{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}} \cdot \sqrt[3]{e^{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\right)}}\right) \cdot \sqrt[3]{e^{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right))_*\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. Initial simplification1.0

    \[\leadsto \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-log-exp1.0

    \[\leadsto \color{blue}{\log \left(e^{\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 add-cube-cbrt0.1

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

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

Reproduce

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

start298.0ms

Algorithm
intervals

setup403.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))

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))

series137.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

105.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
24.0ms
(fma 2/3 PI (/ (acos (/ (- g) h)) 3))
7.0ms
(/ (acos (/ (- g) h)) 3)

simplify232.0ms

Counts
14 → 46
Calls

14 calls. Slowest were:

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

prune658.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 1.0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 59
Calls

4 calls. Slowest were:

8.0ms
(/ (acos (/ (- g) h)) 3)
5.0ms
(log (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
5.0ms
(exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))

series331.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

112.0ms
(exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))
107.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
100.0ms
(log (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
11.0ms
(/ (acos (/ (- g) h)) 3)

simplify544.0ms

Counts
30 → 71
Calls

30 calls. Slowest were:

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

prune1.1s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize19.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)))
0.9b
(/ (acos (/ (- g) h)) 3)

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 47
Calls

4 calls. Slowest were:

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

series267.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

98.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
87.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
73.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
8.0ms
(/ (acos (/ (- g) h)) 3)

simplify347.0ms

Counts
19 → 59
Calls

19 calls. Slowest were:

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

prune1.2s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.0b

localize11.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
(log (sqrt (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))))
1.0b
(log (sqrt (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

3.0ms
(log (sqrt (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))))
3.0ms
(log (sqrt (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))))
2.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

series585.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

207.0ms
(log (sqrt (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))))
204.0ms
(log (sqrt (exp (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))))
88.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
86.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))

simplify657.0ms

Counts
30 → 70
Calls

30 calls. Slowest were:

49.0ms
(log (sqrt (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI))))))
45.0ms
(log (sqrt (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI))))))
44.0ms
(log (sqrt (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI))))))

prune1.4s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.0b

regimes418.0ms

Accuracy

0% (0.1b remaining)

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

bsearch6.0ms