Average Error: 33.7 → 6.8
Time: 2.5m
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}\;-2 \cdot b \le -4.767224559106215 \cdot 10^{+103}:\\ \;\;\;\;\frac{c}{\frac{\frac{3}{2} \cdot c}{\frac{b}{a}} - 2 \cdot b}\\ \mathbf{if}\;-2 \cdot b \le -5.885014676195264 \cdot 10^{-292}:\\ \;\;\;\;\frac{c}{3} \cdot \frac{3}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}\\ \mathbf{if}\;-2 \cdot b \le 2.5993179224325482 \cdot 10^{+82}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot b}{3 \cdot a}\\ \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 (- (* 2 b)) < -4.767224559106215e+103

    1. Initial program 59.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 flip-+59.4

      \[\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. Applied simplify31.9

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

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

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

    if -4.767224559106215e+103 < (- (* 2 b)) < -5.885014676195264e-292

    1. Initial program 32.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 flip-+32.9

      \[\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. Applied simplify16.6

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

      \[\leadsto \frac{\frac{c \cdot \left(a \cdot 3\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{3 \cdot a}\]
    7. Applied times-frac14.9

      \[\leadsto \frac{\color{blue}{\frac{c}{1} \cdot \frac{a \cdot 3}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
    8. Applied times-frac10.5

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

      \[\leadsto \color{blue}{\frac{c}{3}} \cdot \frac{\frac{a \cdot 3}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\]
    10. Applied simplify8.8

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

    if -5.885014676195264e-292 < (- (* 2 b)) < 2.5993179224325482e+82

    1. Initial program 9.4

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

    if 2.5993179224325482e+82 < (- (* 2 b))

    1. Initial program 42.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 add-cube-cbrt42.3

      \[\leadsto \frac{\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}}}}{3 \cdot a}\]
    4. Taylor expanded around -inf 5.7

      \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 2.5m)Debug logProfile

herbie shell --seed '#(1071948828 1180510430 2986424009 997076509 406109801 420189285)' 
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))