Average Error: 35.3 → 31.5
Time: 1.0m
Precision: 64
Internal Precision: 576
\[\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{1}{a}} \cdot \sqrt[3]{\frac{\sqrt{\left(g - h\right) \cdot \left(h + g\right)} - g}{2}} + \sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{\frac{\left(-g\right) - \sqrt{\left(g - h\right) \cdot \left(h + g\right)}}{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 35.3

    \[\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.3

    \[\leadsto \sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \sqrt[3]{\frac{\left(-g\right) - \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}{a \cdot 2}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity35.3

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

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

    \[\leadsto \color{blue}{\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{2}}} + \sqrt[3]{\frac{\left(-g\right) - \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}{a \cdot 2}}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity33.3

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

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

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

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

Runtime

Time bar (total: 1.0m)Debug logProfile

herbie shell --seed 2018217 
(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))))))))