Average Error: 34.1 → 12.7
Time: 9.8s
Precision: binary64
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;b \le -1.34363357950655497 \cdot 10^{154}:\\ \;\;\;\;\frac{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{elif}\;b \le 9.6540809215839408 \cdot 10^{-100}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{elif}\;b \le 8.0622578877255913 \cdot 10^{123}:\\ \;\;\;\;\frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \left|\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}\right| \cdot \sqrt{\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1.5 \cdot \frac{a \cdot c}{b}}{3 \cdot a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Split input into 4 regimes
  2. if b < -1.34363357950655497e154

    1. Initial program 64.0

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Taylor expanded around -inf 10.4

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{3 \cdot a}\]

    if -1.34363357950655497e154 < b < 9.6540809215839408e-100

    1. Initial program 11.4

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]

    if 9.6540809215839408e-100 < b < 8.0622578877255913e123

    1. Initial program 43.1

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
    4. Simplified15.0

      \[\leadsto \frac{\frac{\color{blue}{0 + 3 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt15.2

      \[\leadsto \frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\color{blue}{\left(\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}{3 \cdot a}\]
    7. Applied sqrt-prod15.2

      \[\leadsto \frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \color{blue}{\sqrt{\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}{3 \cdot a}\]
    8. Simplified15.2

      \[\leadsto \frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \color{blue}{\left|\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}\right|} \cdot \sqrt{\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]

    if 8.0622578877255913e123 < b

    1. Initial program 61.1

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Taylor expanded around inf 14.3

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification12.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -1.34363357950655497 \cdot 10^{154}:\\ \;\;\;\;\frac{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{elif}\;b \le 9.6540809215839408 \cdot 10^{-100}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{elif}\;b \le 8.0622578877255913 \cdot 10^{123}:\\ \;\;\;\;\frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \left|\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}\right| \cdot \sqrt{\sqrt[3]{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1.5 \cdot \frac{a \cdot c}{b}}{3 \cdot a}\\ \end{array}\]

Reproduce

herbie shell --seed 2020163 
(FPCore (a b c)
  :name "Cubic critical"
  :precision binary64
  (/ (+ (neg b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))