Average Error: 34.0 → 7.3
Time: 7.5s
Precision: binary64
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -1.20277230402939164 \cdot 10^{70}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 1.84332042700746185 \cdot 10^{-289}:\\ \;\;\;\;1 \cdot \frac{\frac{\sqrt[3]{a}}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{c}}}{\sqrt[3]{a}}\\ \mathbf{elif}\;b_2 \le 2.60439132057774819 \cdot 10^{100}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot 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.20277230402939164e70

    1. Initial program 57.8

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

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

    if -1.20277230402939164e70 < b_2 < 1.84332042700746185e-289

    1. Initial program 30.4

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

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

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

      \[\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 *-un-lft-identity16.9

      \[\leadsto \frac{\frac{0 + a \cdot c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\color{blue}{1 \cdot a}}\]
    8. Applied associate-/r*16.9

      \[\leadsto \color{blue}{\frac{\frac{\frac{0 + a \cdot c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{1}}{a}}\]
    9. Simplified14.4

      \[\leadsto \frac{\color{blue}{\frac{a}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{c}}}}{a}\]
    10. Using strategy rm
    11. Applied add-cube-cbrt15.2

      \[\leadsto \frac{\frac{a}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{c}}}{\color{blue}{\left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right) \cdot \sqrt[3]{a}}}\]
    12. Applied *-un-lft-identity15.2

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

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

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

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

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

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

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

    if 1.84332042700746185e-289 < b_2 < 2.60439132057774819e100

    1. Initial program 9.1

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

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

    if 2.60439132057774819e100 < b_2

    1. Initial program 46.5

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

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

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

      \[\leadsto \frac{\frac{0 + a \cdot c}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Taylor expanded around 0 4.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -1.20277230402939164 \cdot 10^{70}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 1.84332042700746185 \cdot 10^{-289}:\\ \;\;\;\;1 \cdot \frac{\frac{\sqrt[3]{a}}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{c}}}{\sqrt[3]{a}}\\ \mathbf{elif}\;b_2 \le 2.60439132057774819 \cdot 10^{100}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot b_2}{a}\\ \end{array}\]

Reproduce

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