Average Error: 35.1 → 31.2
Time: 1.1m
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]{\sqrt{g \cdot g - h \cdot h} + \left(-g\right)} \cdot \sqrt[3]{\frac{\frac{1}{2}}{a}} + \sqrt[3]{\left(-g\right) - \sqrt{g \cdot g - h \cdot h}} \cdot \sqrt[3]{\frac{\frac{1}{2}}{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. Using strategy rm
  3. Applied cbrt-prod32.9

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

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

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

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

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

Reproduce

herbie shell --seed 2018360 +o rules:numerics
(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: 34.4s)Debug log

start733.0ms

Algorithm
intervals

setup221.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 33.4b

localize47.0ms

Local error

Found 4 expressions with local error:

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

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 66
Calls

4 calls. Slowest were:

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

series592.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

287.0ms
(cbrt (* (/ 1 (* 2 a)) (+ (- g) (sqrt (- (* g g) (* h h))))))
249.0ms
(cbrt (* (/ 1 (* 2 a)) (- (- g) (sqrt (- (* g g) (* h h))))))
32.0ms
(sqrt (- (* g g) (* h h)))
24.0ms
(sqrt (- (* g g) (* h h)))

simplify7.0s

Counts
38 → 78
Calls

38 calls. Slowest were:

857.0ms
(cbrt (* (/ 1 (* 2 a)) (- (* (- g) (- g)) (* (sqrt (- (* g g) (* h h))) (sqrt (- (* g g) (* h h)))))))
855.0ms
(cbrt (* 1 (- (* (- g) (- g)) (* (sqrt (- (* g g) (* h h))) (sqrt (- (* g g) (* h h)))))))
830.0ms
(cbrt (* 1 (- (* (- g) (- g)) (* (sqrt (- (* g g) (* h h))) (sqrt (- (* g g) (* h h)))))))

prune1.5s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 30.0b

localize31.0ms

Local error

Found 4 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 67
Calls

4 calls. Slowest were:

13.0ms
(cbrt (* (/ 1 (* 2 a)) (+ (- g) (sqrt (- (* g g) (* h h))))))
6.0ms
(sqrt (- (* g g) (* h h)))
5.0ms
(sqrt (- (* g g) (* h h)))

series366.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

282.0ms
(cbrt (* (/ 1 (* 2 a)) (+ (- g) (sqrt (- (* g g) (* h h))))))
39.0ms
(sqrt (- (* g g) (* h h)))
28.0ms
(sqrt (- (* g g) (* h h)))
17.0ms
(- (* g g) (* h h))

simplify4.2s

Counts
37 → 79
Calls

37 calls. Slowest were:

850.0ms
(cbrt (* 1 (- (* (- g) (- g)) (* (sqrt (- (* g g) (* h h))) (sqrt (- (* g g) (* h h)))))))
597.0ms
(cbrt (* (/ 1 (* 2 a)) (- (* (- g) (- g)) (* (sqrt (- (* g g) (* h h))) (sqrt (- (* g g) (* h h)))))))
347.0ms
(cbrt (* (/ 1 (* 2 a)) (+ (pow (- g) 3) (pow (sqrt (- (* g g) (* h h))) 3))))

prune1.9s

Pruning

20 alts after pruning (20 fresh and 0 done)

Merged error: 29.5b

localize20.0ms

Local error

Found 4 expressions with local error:

29.4b
(sqrt (- (* g g) (* h h)))
29.4b
(sqrt (- (* g g) (* h h)))
3.2b
(- (* g g) (* h h))
3.2b
(- (* g g) (* h h))

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

5.0ms
(sqrt (- (* g g) (* h h)))
5.0ms
(sqrt (- (* g g) (* h h)))
4.0ms
(- (* g g) (* h h))

series103.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

39.0ms
(sqrt (- (* g g) (* h h)))
25.0ms
(sqrt (- (* g g) (* h h)))
21.0ms
(- (* g g) (* h h))
18.0ms
(- (* g g) (* h h))

simplify1.5s

Counts
36 → 80
Calls

36 calls. Slowest were:

219.0ms
(sqrt (- (pow (* g g) 3) (pow (* h h) 3)))
183.0ms
(sqrt (- (pow (* g g) 3) (pow (* h h) 3)))
169.0ms
(sqrt (- (* (* g g) (* g g)) (* (* h h) (* h h))))

prune1.5s

Pruning

21 alts after pruning (20 fresh and 1 done)

Merged error: 29.5b

localize25.0ms

Local error

Found 4 expressions with local error:

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

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
4 → 103
Calls

4 calls. Slowest were:

9.0ms
(- (- g) (sqrt (- (* g g) (* h h))))
6.0ms
(sqrt (* (+ g h) (- g h)))
5.0ms
(sqrt (- (* g g) (* h h)))

series127.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

52.0ms
(- (- g) (sqrt (- (* g g) (* h h))))
31.0ms
(sqrt (* (+ g h) (- g h)))
23.0ms
(sqrt (- (* g g) (* h h)))
20.0ms
(- (* g g) (* h h))

simplify10.3s

Counts
97 → 115
Calls

97 calls. Slowest were:

630.0ms
(sqrt (* (+ g h) (- (* g g) (* h h))))
534.0ms
(sqrt (* (+ (pow g 3) (pow h 3)) (- (pow g 3) (pow h 3))))
380.0ms
(sqrt (* (+ g h) (- (pow g 3) (pow h 3))))

prune2.4s

Pruning

21 alts after pruning (20 fresh and 1 done)

Merged error: 29.5b

regimes1.7s

Accuracy

0% (1.7b remaining)

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

bsearch4.0ms