Average Error: 35.2 → 31.5
Time: 2.2m
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)}\]
\[\begin{array}{l} \mathbf{if}\;\sqrt[3]{\frac{\left(\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)}} \cdot \sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)}}\right) \cdot \sqrt[3]{\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}} \le -4.339593865332612 \cdot 10^{-107}:\\ \;\;\;\;\frac{\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}}{\sqrt[3]{a \cdot 2}} + \sqrt[3]{\frac{\left(-g\right) - \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}{a \cdot 2}}\\ \mathbf{if}\;\sqrt[3]{\frac{\left(\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)}} \cdot \sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)}}\right) \cdot \sqrt[3]{\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}} \le 1.5669650653888275 \cdot 10^{-107}:\\ \;\;\;\;\sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \frac{\sqrt[3]{\left(-g\right) - g}}{\sqrt[3]{a \cdot 2}}\\ \mathbf{if}\;\sqrt[3]{\frac{\left(\sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)}} \cdot \sqrt[3]{\sqrt{\left(g + h\right) \cdot \left(g - h\right)}}\right) \cdot \sqrt[3]{\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}} \le 2.8912581826610646 \cdot 10^{+97}:\\ \;\;\;\;\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}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \frac{\sqrt[3]{\left(-g\right) - g}}{\sqrt[3]{a \cdot 2}}\\ \end{array}\]

Error

Bits error versus g

Bits error versus h

Bits error versus a

Derivation

  1. Split input into 4 regimes
  2. if (+ (cbrt (/ (- (* (* (cbrt (sqrt (* (+ g h) (- g h)))) (cbrt (sqrt (* (+ g h) (- g h))))) (cbrt (sqrt (* (+ g h) (- g h))))) g) (* a 2))) (cbrt (/ (- (- g) (sqrt (* (+ g h) (- g h)))) (* a 2)))) < -4.339593865332612e-107

    1. Initial program 9.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. Applied simplify9.6

      \[\leadsto \color{blue}{\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 cbrt-div6.7

      \[\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{\left(-g\right) - \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}{a \cdot 2}}\]

    if -4.339593865332612e-107 < (+ (cbrt (/ (- (* (* (cbrt (sqrt (* (+ g h) (- g h)))) (cbrt (sqrt (* (+ g h) (- g h))))) (cbrt (sqrt (* (+ g h) (- g h))))) g) (* a 2))) (cbrt (/ (- (- g) (sqrt (* (+ g h) (- g h)))) (* a 2)))) < 1.5669650653888275e-107

    1. Initial program 60.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. Applied simplify60.6

      \[\leadsto \color{blue}{\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 cbrt-div41.5

      \[\leadsto \sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \color{blue}{\frac{\sqrt[3]{\left(-g\right) - \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}}{\sqrt[3]{a \cdot 2}}}\]
    5. Taylor expanded around inf 7.5

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

    if 1.5669650653888275e-107 < (+ (cbrt (/ (- (* (* (cbrt (sqrt (* (+ g h) (- g h)))) (cbrt (sqrt (* (+ g h) (- g h))))) (cbrt (sqrt (* (+ g h) (- g h))))) g) (* a 2))) (cbrt (/ (- (- g) (sqrt (* (+ g h) (- g h)))) (* a 2)))) < 2.8912581826610646e+97

    1. Initial program 6.0

      \[\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. Applied simplify6.0

      \[\leadsto \color{blue}{\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-identity6.0

      \[\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-frac6.0

      \[\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-prod6.0

      \[\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}}\]

    if 2.8912581826610646e+97 < (+ (cbrt (/ (- (* (* (cbrt (sqrt (* (+ g h) (- g h)))) (cbrt (sqrt (* (+ g h) (- g h))))) (cbrt (sqrt (* (+ g h) (- g h))))) g) (* a 2))) (cbrt (/ (- (- g) (sqrt (* (+ g h) (- g h)))) (* a 2))))

    1. Initial program 62.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. Applied simplify62.1

      \[\leadsto \color{blue}{\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 cbrt-div60.1

      \[\leadsto \sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \color{blue}{\frac{\sqrt[3]{\left(-g\right) - \sqrt{\left(g + h\right) \cdot \left(g - h\right)}}}{\sqrt[3]{a \cdot 2}}}\]
    5. Taylor expanded around inf 60.3

      \[\leadsto \sqrt[3]{\frac{\sqrt{\left(g + h\right) \cdot \left(g - h\right)} - g}{a \cdot 2}} + \frac{\sqrt[3]{\left(-g\right) - \color{blue}{g}}}{\sqrt[3]{a \cdot 2}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 2.2m)Debug logProfile

herbie shell --seed '#(1072107073 2127697367 3936270018 2300570620 2134894798 4023771849)' 
(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))))))))