Average Error: 33.6 → 8.8
Time: 42.0s
Precision: 64
Internal Precision: 3392
\[\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 -5.876128705807586 \cdot 10^{+141}:\\ \;\;\;\;\frac{-c}{\frac{c \cdot a}{b} \cdot \frac{3}{2}}\\ \mathbf{elif}\;b \le 4.45693934297462 \cdot 10^{-299}:\\ \;\;\;\;\frac{\sqrt{(\left(a \cdot 3\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}{a \cdot 3} - \frac{b}{a \cdot 3}\\ \mathbf{elif}\;b \le 2.4281360884698153 \cdot 10^{+132}:\\ \;\;\;\;\frac{-c}{b + \sqrt{(\left(a \cdot 3\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b + b}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Split input into 4 regimes
  2. if b < -5.876128705807586e+141

    1. Initial program 56.2

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Initial simplification56.1

      \[\leadsto \frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied associate-/r*56.1

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{3}}{a}}\]
    5. Using strategy rm
    6. Applied flip--62.2

      \[\leadsto \frac{\frac{\color{blue}{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b \cdot b}{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b}}}{3}}{a}\]
    7. Applied associate-/l/62.2

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b \cdot b}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    8. Simplified62.4

      \[\leadsto \frac{\frac{\color{blue}{\left(-c\right) \cdot \left(3 \cdot a\right)}}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    9. Using strategy rm
    10. Applied distribute-lft-neg-out62.4

      \[\leadsto \frac{\frac{\color{blue}{-c \cdot \left(3 \cdot a\right)}}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    11. Applied distribute-frac-neg62.4

      \[\leadsto \frac{\color{blue}{-\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    12. Applied distribute-frac-neg62.4

      \[\leadsto \color{blue}{-\frac{\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}}\]
    13. Simplified62.3

      \[\leadsto -\color{blue}{\frac{c}{b + \sqrt{(\left(a \cdot 3\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}}\]
    14. Taylor expanded around -inf 21.2

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

    if -5.876128705807586e+141 < b < 4.45693934297462e-299

    1. Initial program 8.8

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Initial simplification8.8

      \[\leadsto \frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied div-sub8.8

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

    if 4.45693934297462e-299 < b < 2.4281360884698153e+132

    1. Initial program 34.4

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Initial simplification34.4

      \[\leadsto \frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied associate-/r*34.4

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{3}}{a}}\]
    5. Using strategy rm
    6. Applied flip--34.5

      \[\leadsto \frac{\frac{\color{blue}{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b \cdot b}{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b}}}{3}}{a}\]
    7. Applied associate-/l/34.5

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b \cdot b}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    8. Simplified16.3

      \[\leadsto \frac{\frac{\color{blue}{\left(-c\right) \cdot \left(3 \cdot a\right)}}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    9. Using strategy rm
    10. Applied distribute-lft-neg-out16.3

      \[\leadsto \frac{\frac{\color{blue}{-c \cdot \left(3 \cdot a\right)}}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    11. Applied distribute-frac-neg16.3

      \[\leadsto \frac{\color{blue}{-\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    12. Applied distribute-frac-neg16.3

      \[\leadsto \color{blue}{-\frac{\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}}\]
    13. Simplified8.6

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

    if 2.4281360884698153e+132 < b

    1. Initial program 61.0

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Initial simplification61.1

      \[\leadsto \frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied associate-/r*61.1

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b}{3}}{a}}\]
    5. Using strategy rm
    6. Applied flip--61.1

      \[\leadsto \frac{\frac{\color{blue}{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b \cdot b}{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b}}}{3}}{a}\]
    7. Applied associate-/l/61.1

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} - b \cdot b}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    8. Simplified35.7

      \[\leadsto \frac{\frac{\color{blue}{\left(-c\right) \cdot \left(3 \cdot a\right)}}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    9. Using strategy rm
    10. Applied distribute-lft-neg-out35.7

      \[\leadsto \frac{\frac{\color{blue}{-c \cdot \left(3 \cdot a\right)}}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    11. Applied distribute-frac-neg35.7

      \[\leadsto \frac{\color{blue}{-\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    12. Applied distribute-frac-neg35.7

      \[\leadsto \color{blue}{-\frac{\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot \left(\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*} + b\right)}}{a}}\]
    13. Simplified34.8

      \[\leadsto -\color{blue}{\frac{c}{b + \sqrt{(\left(a \cdot 3\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}}\]
    14. Taylor expanded around 0 1.7

      \[\leadsto -\frac{c}{b + \color{blue}{b}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification8.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -5.876128705807586 \cdot 10^{+141}:\\ \;\;\;\;\frac{-c}{\frac{c \cdot a}{b} \cdot \frac{3}{2}}\\ \mathbf{elif}\;b \le 4.45693934297462 \cdot 10^{-299}:\\ \;\;\;\;\frac{\sqrt{(\left(a \cdot 3\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}{a \cdot 3} - \frac{b}{a \cdot 3}\\ \mathbf{elif}\;b \le 2.4281360884698153 \cdot 10^{+132}:\\ \;\;\;\;\frac{-c}{b + \sqrt{(\left(a \cdot 3\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b + b}\\ \end{array}\]

Runtime

Time bar (total: 42.0s)Debug logProfile

herbie shell --seed 2018219 +o rules:numerics
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))