2-ancestry mixing, positive discriminant

Percentage Accurate: 44.0% → 95.6%
Time: 18.4s
Alternatives: 5
Speedup: TODO×

Specification

?
\[\begin{array}{l} t_0 := \frac{1}{2 \cdot a}\\ t_1 := -g\\ t_2 := \sqrt{g \cdot g - h \cdot h}\\ \sqrt[3]{t_0 \cdot \left(t_1 + t_2\right)} + \sqrt[3]{t_0 \cdot \left(t_1 - t_2\right)} \end{array} \]

Your Program's Arguments

Results

Enter valid numbers for all inputs

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 5 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Alternative 1?

\[\frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, h\right)}}{\sqrt[3]{a \cdot -2}} \]
Derivation
  1. Initial program 45.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. Step-by-step derivation
    1. associate-/r*45.1%

      \[\leadsto \sqrt[3]{\color{blue}{\frac{\frac{1}{2}}{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. metadata-eval45.1%

      \[\leadsto \sqrt[3]{\frac{\color{blue}{0.5}}{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)} \]
    3. +-commutative45.1%

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

      \[\leadsto \sqrt[3]{\frac{0.5}{a} \cdot \color{blue}{\left(\sqrt{g \cdot g - h \cdot h} - g\right)}} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
    5. fma-neg45.1%

      \[\leadsto \sqrt[3]{\frac{0.5}{a} \cdot \left(\sqrt{\color{blue}{\mathsf{fma}\left(g, g, -h \cdot h\right)}} - g\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \left(\left(-g\right) - \sqrt{g \cdot g - h \cdot h}\right)} \]
    6. sub-neg45.1%

      \[\leadsto \sqrt[3]{\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)} - g\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(\left(-g\right) + \left(-\sqrt{g \cdot g - h \cdot h}\right)\right)}} \]
    7. distribute-neg-out45.1%

      \[\leadsto \sqrt[3]{\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)} - g\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-\left(g + \sqrt{g \cdot g - h \cdot h}\right)\right)}} \]
    8. neg-mul-145.1%

      \[\leadsto \sqrt[3]{\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)} - g\right)} + \sqrt[3]{\frac{1}{2 \cdot a} \cdot \color{blue}{\left(-1 \cdot \left(g + \sqrt{g \cdot g - h \cdot h}\right)\right)}} \]
    9. associate-*r*45.1%

      \[\leadsto \sqrt[3]{\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)} - g\right)} + \sqrt[3]{\color{blue}{\left(\frac{1}{2 \cdot a} \cdot -1\right) \cdot \left(g + \sqrt{g \cdot g - h \cdot h}\right)}} \]
  3. Simplified45.2%

    \[\leadsto \color{blue}{\sqrt[3]{\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)} - g\right)} + \sqrt[3]{\frac{g + \sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)}}{\frac{a}{-0.5}}}} \]
  4. Step-by-step derivation
    1. associate-*l/45.1%

      \[\leadsto \sqrt[3]{\color{blue}{\frac{0.5 \cdot \left(\sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)} - g\right)}{a}}} + \sqrt[3]{\frac{g + \sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)}}{\frac{a}{-0.5}}} \]
    2. cbrt-div47.8%

      \[\leadsto \color{blue}{\frac{\sqrt[3]{0.5 \cdot \left(\sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)} - g\right)}}{\sqrt[3]{a}}} + \sqrt[3]{\frac{g + \sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)}}{\frac{a}{-0.5}}} \]
  5. Applied egg-rr48.3%

    \[\leadsto \color{blue}{\frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}}} + \sqrt[3]{\frac{g + \sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)}}{\frac{a}{-0.5}}} \]
  6. Step-by-step derivation
    1. cbrt-div48.7%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \color{blue}{\frac{\sqrt[3]{g + \sqrt{\mathsf{fma}\left(g, g, -h \cdot h\right)}}}{\sqrt[3]{\frac{a}{-0.5}}}} \]
    2. fma-udef48.7%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \sqrt{\color{blue}{g \cdot g + \left(-h \cdot h\right)}}}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    3. add-sqr-sqrt26.0%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \sqrt{g \cdot g + \color{blue}{\sqrt{-h \cdot h} \cdot \sqrt{-h \cdot h}}}}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    4. hypot-def43.8%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \color{blue}{\mathsf{hypot}\left(g, \sqrt{-h \cdot h}\right)}}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    5. add-sqr-sqrt43.8%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, \sqrt{\color{blue}{\sqrt{-h \cdot h} \cdot \sqrt{-h \cdot h}}}\right)}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    6. sqrt-unprod82.1%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, \sqrt{\color{blue}{\sqrt{\left(-h \cdot h\right) \cdot \left(-h \cdot h\right)}}}\right)}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    7. sqr-neg82.1%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, \sqrt{\sqrt{\color{blue}{\left(h \cdot h\right) \cdot \left(h \cdot h\right)}}}\right)}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    8. sqrt-unprod89.4%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, \sqrt{\color{blue}{\sqrt{h \cdot h} \cdot \sqrt{h \cdot h}}}\right)}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    9. add-sqr-sqrt89.4%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, \sqrt{\color{blue}{h \cdot h}}\right)}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    10. sqrt-prod44.2%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, \color{blue}{\sqrt{h} \cdot \sqrt{h}}\right)}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    11. add-sqr-sqrt95.2%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, \color{blue}{h}\right)}}{\sqrt[3]{\frac{a}{-0.5}}} \]
    12. div-inv95.2%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, h\right)}}{\sqrt[3]{\color{blue}{a \cdot \frac{1}{-0.5}}}} \]
    13. metadata-eval95.2%

      \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \frac{\sqrt[3]{g + \mathsf{hypot}\left(g, h\right)}}{\sqrt[3]{a \cdot \color{blue}{-2}}} \]
  7. Applied egg-rr95.2%

    \[\leadsto \frac{\sqrt[3]{0.5 \cdot \left(\mathsf{hypot}\left(g, h\right) - g\right)}}{\sqrt[3]{a}} + \color{blue}{\frac{\sqrt[3]{g + \mathsf{hypot}\left(g, h\right)}}{\sqrt[3]{a \cdot -2}}} \]
  8. Final simplification95.2%

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

Alternative 2?

\[\sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \frac{\sqrt[3]{g}}{\sqrt[3]{-a}} \]
Derivation
  1. Initial program 45.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. Step-by-step derivation
    1. Simplified45.1%

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

      \[\leadsto \sqrt[3]{\left(g - \color{blue}{g}\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right) \cdot \frac{-0.5}{a}} \]
    3. Taylor expanded in g around inf 74.0%

      \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
    4. Step-by-step derivation
      1. associate-*r/74.0%

        \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{\frac{-1 \cdot g}{a}}} \]
      2. mul-1-neg74.0%

        \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
    5. Simplified74.0%

      \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
    6. Step-by-step derivation
      1. frac-2neg74.0%

        \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{\frac{-\left(-g\right)}{-a}}} \]
      2. cbrt-div95.2%

        \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \color{blue}{\frac{\sqrt[3]{-\left(-g\right)}}{\sqrt[3]{-a}}} \]
      3. remove-double-neg95.2%

        \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \frac{\sqrt[3]{\color{blue}{g}}}{\sqrt[3]{-a}} \]
    7. Applied egg-rr95.2%

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

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

    Alternative 3?

    \[\sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\frac{-0.5}{a} \cdot \left(g + g\right)} \]
    Derivation
    1. Initial program 45.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. Step-by-step derivation
      1. Simplified45.1%

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

        \[\leadsto \sqrt[3]{\left(g - \color{blue}{g}\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right) \cdot \frac{-0.5}{a}} \]
      3. Taylor expanded in g around inf 74.0%

        \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\left(g + \color{blue}{g}\right) \cdot \frac{-0.5}{a}} \]
      4. Final simplification74.0%

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

      Alternative 4?

      \[\sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\frac{-g}{a}} \]
      Derivation
      1. Initial program 45.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. Step-by-step derivation
        1. Simplified45.1%

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

          \[\leadsto \sqrt[3]{\left(g - \color{blue}{g}\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right) \cdot \frac{-0.5}{a}} \]
        3. Taylor expanded in g around inf 74.0%

          \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
        4. Step-by-step derivation
          1. associate-*r/74.0%

            \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{\frac{-1 \cdot g}{a}}} \]
          2. mul-1-neg74.0%

            \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
        5. Simplified74.0%

          \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
        6. Final simplification74.0%

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

        Alternative 5?

        \[\sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\frac{g}{a}} \]
        Derivation
        1. Initial program 45.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. Step-by-step derivation
          1. Simplified45.1%

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

            \[\leadsto \sqrt[3]{\left(g - \color{blue}{g}\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\left(g + \sqrt{\left(g + h\right) \cdot \left(g - h\right)}\right) \cdot \frac{-0.5}{a}} \]
          3. Taylor expanded in g around inf 74.0%

            \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{-1 \cdot \frac{g}{a}}} \]
          4. Step-by-step derivation
            1. associate-*r/74.0%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{\frac{-1 \cdot g}{a}}} \]
            2. mul-1-neg74.0%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\frac{\color{blue}{-g}}{a}} \]
          5. Simplified74.0%

            \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \sqrt[3]{\color{blue}{\frac{-g}{a}}} \]
          6. Step-by-step derivation
            1. expm1-log1p-u50.4%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\frac{-g}{a}}\right)\right)} \]
            2. expm1-udef24.9%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt[3]{\frac{-g}{a}}\right)} - 1\right)} \]
            3. add-sqr-sqrt13.4%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \left(e^{\mathsf{log1p}\left(\sqrt[3]{\frac{\color{blue}{\sqrt{-g} \cdot \sqrt{-g}}}{a}}\right)} - 1\right) \]
            4. sqrt-unprod8.9%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \left(e^{\mathsf{log1p}\left(\sqrt[3]{\frac{\color{blue}{\sqrt{\left(-g\right) \cdot \left(-g\right)}}}{a}}\right)} - 1\right) \]
            5. sqr-neg8.9%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \left(e^{\mathsf{log1p}\left(\sqrt[3]{\frac{\sqrt{\color{blue}{g \cdot g}}}{a}}\right)} - 1\right) \]
            6. sqrt-unprod0.7%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \left(e^{\mathsf{log1p}\left(\sqrt[3]{\frac{\color{blue}{\sqrt{g} \cdot \sqrt{g}}}{a}}\right)} - 1\right) \]
            7. add-sqr-sqrt1.5%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \left(e^{\mathsf{log1p}\left(\sqrt[3]{\frac{\color{blue}{g}}{a}}\right)} - 1\right) \]
          7. Applied egg-rr1.5%

            \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt[3]{\frac{g}{a}}\right)} - 1\right)} \]
          8. Step-by-step derivation
            1. expm1-def1.1%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\frac{g}{a}}\right)\right)} \]
            2. expm1-log1p1.4%

              \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \color{blue}{\sqrt[3]{\frac{g}{a}}} \]
          9. Simplified1.4%

            \[\leadsto \sqrt[3]{\left(g - g\right) \cdot \frac{-0.5}{a}} + \color{blue}{\sqrt[3]{\frac{g}{a}}} \]
          10. Final simplification1.4%

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

          Reproduce

          ?
          herbie shell --seed 2023166 
          (FPCore (g h a)
            :name "2-ancestry mixing, positive discriminant"
            :precision binary64
            (+ (cbrt (* (/ 1.0 (* 2.0 a)) (+ (- g) (sqrt (- (* g g) (* h h)))))) (cbrt (* (/ 1.0 (* 2.0 a)) (- (- g) (sqrt (- (* g g) (* h h))))))))