Average Error: 1.0 → 1.0
Time: 16.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 \log_* (1 + (e^{\cos \left((\frac{2}{3} \cdot \pi + \left(\frac{\cos^{-1} \left(-\frac{g}{h}\right)}{3}\right))_*\right)} - 1)^*)\]

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 log1p-expm1-u1.0

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

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

Reproduce

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

start265.0ms

Algorithm
intervals

setup51.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 1.0b

localize59.0ms

Local error

Found 3 expressions with local error:

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

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

series175.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

121.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
41.0ms
(fma 2/3 PI (/ (acos (/ (- g) h)) 3))
12.0ms
(/ (acos (/ (- g) h)) 3)

simplify264.0ms

Counts
14 → 46
Calls

14 calls. Slowest were:

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

prune746.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 1.0b

localize30.0ms

Local error

Found 4 expressions with local error:

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

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 81
Calls

4 calls. Slowest were:

9.0ms
(* (sqrt (/ (acos (/ (- g) h)) 3)) (sqrt (/ (acos (/ (- g) h)) 3)))
7.0ms
(cos (fma 2/3 PI (* (sqrt (/ (acos (/ (- g) h)) 3)) (sqrt (/ (acos (/ (- g) h)) 3)))))
6.0ms
(/ (acos (/ (- g) h)) 3)

series230.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

166.0ms
(cos (fma 2/3 PI (* (sqrt (/ (acos (/ (- g) h)) 3)) (sqrt (/ (acos (/ (- g) h)) 3)))))
50.0ms
(* (sqrt (/ (acos (/ (- g) h)) 3)) (sqrt (/ (acos (/ (- g) h)) 3)))
7.0ms
(/ (acos (/ (- g) h)) 3)
7.0ms
(/ (acos (/ (- g) h)) 3)

simplify699.0ms

Counts
49 → 93
Calls

49 calls. Slowest were:

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

prune1.6s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 1.0b

localize10.0ms

Local error

Found 4 expressions with local error:

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

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

series415.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

179.0ms
(log1p (expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))))
134.0ms
(expm1 (cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3))))
88.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
13.0ms
(/ (acos (/ (- g) h)) 3)

simplify414.0ms

Counts
19 → 61
Calls

19 calls. Slowest were:

50.0ms
(- (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))) 1)
47.0ms
(- (exp (cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))) 1)
40.0ms
(cos (+ (* 1/3 (acos (* -1 (/ g h)))) (* 2/3 PI)))

prune1.0s

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 1.0b

localize24.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
(/ (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)))

series293.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

108.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
96.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
81.0ms
(cos (fma 2/3 PI (/ (acos (/ (- g) h)) 3)))
7.0ms
(/ (acos (/ (- g) h)) 3)

simplify409.0ms

Counts
19 → 59
Calls

19 calls. Slowest were:

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

prune1.1s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 1.0b

regimes358.0ms

Accuracy

0% (0.0b remaining)

Error of 1.0b against oracle of 1.0b and baseline of 1.0b

bsearch3.0ms