Average Error: 34.6 → 31.0
Time: 58.7s
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)}\]
\[\frac{\sqrt[3]{\frac{-1}{2} \cdot \left(\left(\sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} + g} \cdot \sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} + g}\right) \cdot \sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} + g}\right)}}{\sqrt[3]{a}} + \sqrt[3]{\sqrt{\left(h + g\right) \cdot \left(g - h\right)} - g} \cdot \sqrt[3]{\frac{1}{a \cdot 2}}\]

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 34.6

    \[\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 simplification34.6

    \[\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 div-inv34.6

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

    \[\leadsto \color{blue}{\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g} \cdot \sqrt[3]{\frac{1}{a \cdot 2}}} + \sqrt[3]{\frac{\frac{-1}{2}}{a} \cdot \left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right)}\]
  6. Using strategy rm
  7. Applied associate-*l/32.7

    \[\leadsto \sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g} \cdot \sqrt[3]{\frac{1}{a \cdot 2}} + \sqrt[3]{\color{blue}{\frac{\frac{-1}{2} \cdot \left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right)}{a}}}\]
  8. Applied cbrt-div31.0

    \[\leadsto \sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g} \cdot \sqrt[3]{\frac{1}{a \cdot 2}} + \color{blue}{\frac{\sqrt[3]{\frac{-1}{2} \cdot \left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right)}}{\sqrt[3]{a}}}\]
  9. Using strategy rm
  10. Applied add-cube-cbrt31.0

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

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

Reproduce

herbie shell --seed 2018362 
(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.6s)Debug log

start722.0ms

Algorithm
intervals

setup297.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 35.6b

localize75.0ms

Local error

Found 4 expressions with local error:

29.5b
(sqrt (* (+ g h) (- g h)))
29.5b
(sqrt (* (+ g h) (- g h)))
11.6b
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))
10.0b
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))

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

series695.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

326.0ms
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))
267.0ms
(cbrt (/ (- (sqrt (* (+ g h) (- g h))) g) (* a 2)))
51.0ms
(sqrt (* (+ g h) (- g h)))
50.0ms
(sqrt (* (+ g h) (- g h)))

simplify6.4s

Counts
44 → 76
Calls

44 calls. Slowest were:

503.0ms
(sqrt (* (+ (pow g 3) (pow h 3)) (- (* g g) (* h h))))
470.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
365.0ms
(* (cbrt 1/2) (exp (* 1/3 (- (+ (log (/ -1 g)) (+ (log (/ -1 a)) (log -1/2))) (* 2 (log (/ -1 h)))))))

prune1.7s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 29.9b

localize15.0ms

Local error

Found 4 expressions with local error:

29.5b
(sqrt (* (+ g h) (- g h)))
29.5b
(sqrt (* (+ g h) (- g h)))
10.0b
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))
2.4b
(+ g (sqrt (* (+ g h) (- g h))))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

2.0ms
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))
1.0ms
(sqrt (* (+ g h) (- g h)))
1.0ms
(sqrt (* (+ g h) (- g h)))

series466.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

337.0ms
(cbrt (* (/ -1/2 a) (+ g (sqrt (* (+ g h) (- g h))))))
60.0ms
(+ g (sqrt (* (+ g h) (- g h))))
35.0ms
(sqrt (* (+ g h) (- g h)))
34.0ms
(sqrt (* (+ g h) (- g h)))

simplify4.9s

Counts
36 → 70
Calls

36 calls. Slowest were:

385.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
349.0ms
(sqrt (* (+ (pow g 3) (pow h 3)) (- g h)))
335.0ms
(* (cbrt 1/2) (exp (* 1/3 (- (+ (log (/ -1 g)) (+ (log (/ -1 a)) (log -1/2))) (* 2 (log (/ -1 h)))))))

prune1.6s

Pruning

22 alts after pruning (22 fresh and 0 done)

Merged error: 29.7b

localize22.0ms

Local error

Found 4 expressions with local error:

29.5b
(sqrt (* (+ g h) (- g h)))
29.5b
(sqrt (* (+ g h) (- g h)))
2.4b
(+ g (sqrt (* (+ g h) (- g h))))
1.0b
(- (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)))

series149.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

44.0ms
(- (sqrt (* (+ g h) (- g h))) g)
38.0ms
(sqrt (* (+ g h) (- g h)))
37.0ms
(+ g (sqrt (* (+ g h) (- g h))))
31.0ms
(sqrt (* (+ g h) (- g h)))

simplify3.2s

Counts
30 → 67
Calls

30 calls. Slowest were:

416.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
408.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
338.0ms
(sqrt (* (+ (pow g 3) (pow h 3)) (- g h)))

prune1.7s

Pruning

21 alts after pruning (21 fresh and 0 done)

Merged error: 29.7b

localize29.0ms

Local error

Found 4 expressions with local error:

29.5b
(sqrt (* (+ g h) (- g h)))
29.5b
(sqrt (* (+ g h) (- g h)))
2.4b
(+ g (sqrt (* (+ g h) (- g h))))
1.0b
(- (sqrt (* (+ g h) (- g h))) g)

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 55
Calls

4 calls. Slowest were:

9.0ms
(- (sqrt (* (+ g h) (- g h))) g)
2.0ms
(sqrt (* (+ g h) (- g h)))
2.0ms
(sqrt (* (+ g h) (- g h)))

series147.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

37.0ms
(+ g (sqrt (* (+ g h) (- g h))))
37.0ms
(sqrt (* (+ g h) (- g h)))
37.0ms
(sqrt (* (+ g h) (- g h)))
36.0ms
(- (sqrt (* (+ g h) (- g h))) g)

simplify3.3s

Counts
30 → 67
Calls

30 calls. Slowest were:

407.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
393.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
362.0ms
(sqrt (* (+ (pow g 3) (pow h 3)) (- g h)))

prune1.3s

Pruning

21 alts after pruning (21 fresh and 0 done)

Merged error: 29.7b

regimes787.0ms

Accuracy

0% (1.2b remaining)

Error of 31.0b against oracle of 29.8b and baseline of 31.0b

bsearch3.0ms