Average Error: 34.3 → 7.8
Time: 51.3s
Precision: 64
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -1.8788058561239443 \cdot 10^{41}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -5.5122803649133467 \cdot 10^{-262}:\\ \;\;\;\;\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}} \cdot \frac{\frac{\sqrt[3]{1}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}{c}}}{\sqrt[3]{a}}\\ \mathbf{elif}\;b_2 \le 6.0770683902858688 \cdot 10^{60}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Derivation

  1. Split input into 4 regimes
  2. if b_2 < -1.8788058561239443e+41

    1. Initial program 57.4

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Taylor expanded around -inf 4.1

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b_2}}\]

    if -1.8788058561239443e+41 < b_2 < -5.512280364913347e-262

    1. Initial program 30.3

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--30.3

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a}\]
    4. Simplified16.5

      \[\leadsto \frac{\frac{\color{blue}{0 + a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Simplified16.5

      \[\leadsto \frac{\frac{0 + a \cdot c}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Using strategy rm
    7. Applied clear-num16.7

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{0 + a \cdot c}}}}{a}\]
    8. Simplified13.7

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}}{c}}}}{a}\]
    9. Using strategy rm
    10. Applied add-cube-cbrt14.4

      \[\leadsto \frac{\frac{1}{\frac{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}}{c}}}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}\]
    11. Applied *-un-lft-identity14.4

      \[\leadsto \frac{\frac{1}{\frac{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}}{\color{blue}{1 \cdot c}}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    12. Applied add-cube-cbrt13.7

      \[\leadsto \frac{\frac{1}{\frac{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}}{1 \cdot c}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    13. Applied add-cube-cbrt14.4

      \[\leadsto \frac{\frac{1}{\frac{\frac{\color{blue}{\left(\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}\right) \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}{1 \cdot c}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    14. Applied times-frac14.4

      \[\leadsto \frac{\frac{1}{\frac{\color{blue}{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}}{1 \cdot c}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    15. Applied times-frac14.2

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}}{1} \cdot \frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}{c}}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    16. Applied add-cube-cbrt14.2

      \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}}{1} \cdot \frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}{c}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    17. Applied times-frac13.9

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}{c}}}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}\]
    18. Applied times-frac10.7

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}}{1}}}{\sqrt[3]{a} \cdot \sqrt[3]{a}} \cdot \frac{\frac{\sqrt[3]{1}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}{c}}}{\sqrt[3]{a}}}\]
    19. Simplified10.7

      \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}}} \cdot \frac{\frac{\sqrt[3]{1}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}{c}}}{\sqrt[3]{a}}\]

    if -5.512280364913347e-262 < b_2 < 6.077068390285869e+60

    1. Initial program 10.7

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]

    if 6.077068390285869e+60 < b_2

    1. Initial program 39.9

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Taylor expanded around inf 5.6

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification7.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -1.8788058561239443 \cdot 10^{41}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -5.5122803649133467 \cdot 10^{-262}:\\ \;\;\;\;\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a} \cdot \sqrt[3]{a}}} \cdot \frac{\frac{\sqrt[3]{1}}{\frac{\frac{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\sqrt[3]{a}}}{c}}}{\sqrt[3]{a}}\\ \mathbf{elif}\;b_2 \le 6.0770683902858688 \cdot 10^{60}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\ \end{array}\]

Reproduce

herbie shell --seed 2020126 
(FPCore (a b_2 c)
  :name "quad2m (problem 3.2.1, negative)"
  :precision binary64
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))