Average Error: 33.8 → 29.4
Time: 42.3s
Precision: 64
Internal Precision: 3456
\[\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.4090536954163926 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1}{3} \cdot \frac{b}{a}\\ \mathbf{if}\;b \le 4.3407368850217713 \cdot 10^{+108}:\\ \;\;\;\;\frac{\frac{(\left(\sqrt{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(\left(3 \cdot a\right) \cdot \left(-c\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{3}}{a}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Split input into 3 regimes
  2. if b < -1.4090536954163926e+154

    1. Initial program 60.9

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Applied simplify60.9

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

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

    if -1.4090536954163926e+154 < b < 4.3407368850217713e+108

    1. Initial program 20.5

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Applied simplify20.5

      \[\leadsto \color{blue}{\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*20.5

      \[\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 add-sqr-sqrt20.5

      \[\leadsto \frac{\frac{\sqrt{\color{blue}{\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}{3}}{a}\]
    7. Applied sqrt-prod21.2

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

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

    if 4.3407368850217713e+108 < b

    1. Initial program 58.9

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Applied simplify58.9

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

      \[\leadsto \frac{\color{blue}{0}}{3 \cdot a}\]
    4. Applied simplify40.3

      \[\leadsto \color{blue}{0}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 42.3s)Debug logProfile

herbie shell --seed '#(1070386091 2509006183 1430610344 1025408621 36622005 1425925650)' +o rules:numerics
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))