Average Error: 33.2 → 7.1
Time: 1.6m
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 -3.5753788610364395 \cdot 10^{+137}:\\ \;\;\;\;\frac{\frac{1}{\frac{-3}{2}}}{\frac{a}{b}}\\ \mathbf{if}\;b \le 4.626302608998992 \cdot 10^{-298}:\\ \;\;\;\;\frac{1}{\frac{3 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\\ \mathbf{if}\;b \le 1.3807673195223642 \cdot 10^{+87}:\\ \;\;\;\;\frac{1}{\frac{1}{c} \cdot \left(\left(-b\right) - \left(\sqrt[3]{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right) \cdot \sqrt[3]{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}} - \left(b + b\right)}\\ \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 < -3.5753788610364395e+137

    1. Initial program 55.2

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

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

      \[\leadsto \frac{1}{\frac{3 \cdot a}{\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}}}}}\]
    6. Applied associate-/r/62.1

      \[\leadsto \frac{1}{\color{blue}{\frac{3 \cdot a}{\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}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
    7. Applied simplify62.3

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{c}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
    8. Taylor expanded around -inf 21.3

      \[\leadsto \frac{1}{\frac{1}{c} \cdot \color{blue}{\left(\frac{-3}{2} \cdot \frac{c \cdot a}{b}\right)}}\]
    9. Applied simplify3.0

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

    if -3.5753788610364395e+137 < b < 4.626302608998992e-298

    1. Initial program 9.7

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

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

    if 4.626302608998992e-298 < b < 1.3807673195223642e+87

    1. Initial program 31.8

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

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

      \[\leadsto \frac{1}{\frac{3 \cdot a}{\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}}}}}\]
    6. Applied associate-/r/32.0

      \[\leadsto \frac{1}{\color{blue}{\frac{3 \cdot a}{\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}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
    7. Applied simplify8.9

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{c}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
    8. Using strategy rm
    9. Applied add-cube-cbrt9.5

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

    if 1.3807673195223642e+87 < b

    1. Initial program 57.4

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

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

      \[\leadsto \frac{1}{\frac{3 \cdot a}{\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}}}}}\]
    6. Applied associate-/r/57.5

      \[\leadsto \frac{1}{\color{blue}{\frac{3 \cdot a}{\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}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
    7. Applied simplify29.3

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{c}} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
    8. Taylor expanded around inf 7.7

      \[\leadsto \frac{1}{\frac{1}{c} \cdot \color{blue}{\left(\frac{3}{2} \cdot \frac{c \cdot a}{b} - 2 \cdot b\right)}}\]
    9. Applied simplify2.6

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

Runtime

Time bar (total: 1.6m)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' 
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))