Average Error: 35.1 → 31.2
Time: 58.6s
Precision: 64
Internal Precision: 128
\[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\]
\[\sqrt[3]{\frac{\frac{-1}{2}}{a}} \cdot \sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} + g} + \frac{\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{2 \cdot a}}\]

Error

Bits error versus g

Bits error versus h

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 35.1

    \[\sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) + \sqrt{g \cdot g - h \cdot h}\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)}\]
  2. Initial simplification35.1

    \[\leadsto \sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \sqrt[3]{\frac{\frac{-1}{2}}{a} \cdot \left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right)}\]
  3. Using strategy rm
  4. Applied cbrt-prod32.9

    \[\leadsto \sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \color{blue}{\sqrt[3]{\frac{\frac{-1}{2}}{a}} \cdot \sqrt[3]{g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}}\]
  5. Using strategy rm
  6. Applied cbrt-div31.2

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{a \cdot 2}}} + \sqrt[3]{\frac{\frac{-1}{2}}{a}} \cdot \sqrt[3]{g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}\]
  7. Final simplification31.2

    \[\leadsto \sqrt[3]{\frac{\frac{-1}{2}}{a}} \cdot \sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} + g} + \frac{\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{2 \cdot a}}\]

Reproduce

herbie shell --seed 2018360 
(FPCore (g h a)
  :name "2-ancestry mixing, positive discriminant"
  (+ (cbrt (* (/ 1 (* 2 a)) (+ (- g) (sqrt (- (* g g) (* h h)))))) (cbrt (* (/ 1 (* 2 a)) (- (- g) (sqrt (- (* g g) (* h h))))))))

Details

Time bar (total: 27.8s)Debug log

start745.0ms

Algorithm
intervals

setup224.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 33.4b

localize86.0ms

Local error

Found 4 expressions with local error:

29.4b
(sqrt (* (+ g h) (- g h)))
29.4b
(sqrt (* (+ g h) (- g h)))
9.8b
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))
6.4b
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

4.0ms
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))
4.0ms
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))
3.0ms
(sqrt (* (+ g h) (- g h)))

series650.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

327.0ms
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))
229.0ms
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))
48.0ms
(sqrt (* (+ g h) (- g h)))
47.0ms
(sqrt (* (+ g h) (- g h)))

simplify6.6s

Counts
44 → 76
Calls

44 calls. Slowest were:

577.0ms
(sqrt (* (+ (pow g 3) (pow h 3)) (- g h)))
410.0ms
(* (exp (* 1/3 (- (+ (log 2) (log (/ -1 a))) (log (/ -1 g))))) (cbrt -1/2))
394.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))

prune1.7s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 30.1b

localize21.0ms

Local error

Found 4 expressions with local error:

29.4b
(sqrt (* (+ g h) (- g h)))
29.4b
(sqrt (* (+ g h) (- g h)))
6.4b
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))
2.1b
(+ g (sqrt (* (+ g h) (- g h))))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

4.0ms
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))
3.0ms
(sqrt (* (+ g h) (- g h)))
2.0ms
(sqrt (* (+ g h) (- g h)))

series423.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

268.0ms
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))
56.0ms
(+ g (sqrt (* (+ g h) (- g h))))
50.0ms
(sqrt (* (+ g h) (- g h)))
49.0ms
(sqrt (* (+ g h) (- g h)))

simplify4.9s

Counts
38 → 72
Calls

38 calls. Slowest were:

407.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
407.0ms
(* (exp (* 1/3 (- (+ (log 2) (log (/ -1 a))) (log (/ -1 g))))) (cbrt -1/2))
380.0ms
(sqrt (* (+ g h) (- (pow g 3) (pow h 3))))

prune1.4s

Pruning

20 alts after pruning (20 fresh and 0 done)

Merged error: 30.1b

localize17.0ms

Local error

Found 4 expressions with local error:

29.4b
(sqrt (* (+ g h) (- g h)))
29.4b
(sqrt (* (+ g h) (- g h)))
2.1b
(+ g (sqrt (* (+ g h) (- g h))))
1.3b
(- (sqrt (* (+ g h) (- g h))) g)

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 55
Calls

4 calls. Slowest were:

5.0ms
(- (sqrt (* (+ g h) (- g h))) g)
1.0ms
(sqrt (* (+ g h) (- g h)))
1.0ms
(sqrt (* (+ g h) (- g h)))

series187.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

51.0ms
(+ g (sqrt (* (+ g h) (- g h))))
47.0ms
(- (sqrt (* (+ g h) (- g h))) g)
46.0ms
(sqrt (* (+ g h) (- g h)))
42.0ms
(sqrt (* (+ g h) (- g h)))

simplify3.4s

Counts
30 → 67
Calls

30 calls. Slowest were:

395.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
339.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
302.0ms
(sqrt (* (+ g h) (- (pow g 3) (pow h 3))))

prune1.7s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 30.1b

localize27.0ms

Local error

Found 4 expressions with local error:

29.4b
(sqrt (* (+ g h) (- g h)))
29.4b
(sqrt (* (+ g h) (- g h)))
2.1b
(+ g (sqrt (* (+ g h) (- g h))))
1.3b
(- (sqrt (* (+ g h) (- g h))) g)

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 55
Calls

4 calls. Slowest were:

6.0ms
(- (sqrt (* (+ g h) (- g h))) g)
3.0ms
(sqrt (* (+ g h) (- g h)))
2.0ms
(sqrt (* (+ g h) (- g h)))

series161.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

44.0ms
(- (sqrt (* (+ g h) (- g h))) g)
43.0ms
(+ g (sqrt (* (+ g h) (- g h))))
41.0ms
(sqrt (* (+ g h) (- g h)))
34.0ms
(sqrt (* (+ g h) (- g h)))

simplify3.2s

Counts
30 → 67
Calls

30 calls. Slowest were:

364.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
327.0ms
(sqrt (* (+ g h) (- (pow g 3) (pow h 3))))
295.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))

prune1.6s

Pruning

18 alts after pruning (18 fresh and 0 done)

Merged error: 30.1b

regimes587.0ms

Accuracy

0% (1.2b remaining)

Error of 31.2b against oracle of 29.9b and baseline of 31.2b

bsearch4.0ms