Average Error: 33.2 → 11.6
Time: 56.6s
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 -1.973916339598956 \cdot 10^{+117}:\\ \;\;\;\;\frac{\frac{3}{2} \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{if}\;b \le 5.985980878209164 \cdot 10^{-05}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} + \left(-b\right)}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot \frac{\frac{-3}{2}}{3}\\ \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.973916339598956e+117

    1. Initial program 49.6

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

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

    if -1.973916339598956e+117 < b < 5.985980878209164e-05

    1. Initial program 15.5

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

    if 5.985980878209164e-05 < b

    1. Initial program 54.4

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

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

      \[\leadsto \color{blue}{1 \cdot \left(\frac{c}{b} \cdot \frac{\frac{-3}{2}}{3}\right)}\]
  3. Recombined 3 regimes into one program.
  4. Applied simplify11.6

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b \le -1.973916339598956 \cdot 10^{+117}:\\ \;\;\;\;\frac{\frac{3}{2} \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{if}\;b \le 5.985980878209164 \cdot 10^{-05}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} + \left(-b\right)}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot \frac{\frac{-3}{2}}{3}\\ \end{array}}\]

Runtime

Time bar (total: 56.6s)Debug logProfile

herbie shell --seed '#(1071246582 2318319007 2683472949 3810440501 3233274817 2724848749)' 
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))