Average Error: 33.7 → 10.8
Time: 24.3s
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 -4.379635448016287 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{1}{\frac{\frac{-3}{2}}{b}}}{a}\\ \mathbf{elif}\;b \le 5.55407453522487 \cdot 10^{-233}:\\ \;\;\;\;\frac{\frac{1}{3}}{\frac{a}{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} + \left(-b\right)}}\\ \mathbf{elif}\;b \le 1.3686035426592422 \cdot 10^{+154}:\\ \;\;\;\;\frac{\frac{\left(c \cdot 3\right) \cdot a}{3 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)}\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{(\left(\frac{b}{c}\right) \cdot \left(\frac{-2}{a}\right) + \left(\frac{\frac{3}{2}}{b}\right))_*}}{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 b < -4.379635448016287e+66

    1. Initial program 39.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 associate-/r*39.4

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

      \[\leadsto \frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3}}{a}\]
    6. Using strategy rm
    7. Applied clear-num39.4

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

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

    if -4.379635448016287e+66 < b < 5.55407453522487e-233

    1. Initial program 9.9

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

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

      \[\leadsto \frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3}}{a}\]
    6. Using strategy rm
    7. Applied clear-num10.0

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{3}{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}}}}{a}\]
    8. Using strategy rm
    9. Applied associate-/r/10.0

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

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

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

    if 5.55407453522487e-233 < b < 1.3686035426592422e+154

    1. Initial program 37.0

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} \cdot \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}}}{3}}{a}\]
    8. Applied associate-/l/37.1

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

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

    if 1.3686035426592422e+154 < b

    1. Initial program 62.9

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

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

      \[\leadsto \frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3}}{a}\]
    6. Using strategy rm
    7. Applied clear-num62.9

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

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{3}{2} \cdot \frac{1}{b} - 2 \cdot \frac{b}{a \cdot c}}}}{a}\]
    9. Simplified9.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -4.379635448016287 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{1}{\frac{\frac{-3}{2}}{b}}}{a}\\ \mathbf{elif}\;b \le 5.55407453522487 \cdot 10^{-233}:\\ \;\;\;\;\frac{\frac{1}{3}}{\frac{a}{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} + \left(-b\right)}}\\ \mathbf{elif}\;b \le 1.3686035426592422 \cdot 10^{+154}:\\ \;\;\;\;\frac{\frac{\left(c \cdot 3\right) \cdot a}{3 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)}\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{(\left(\frac{b}{c}\right) \cdot \left(\frac{-2}{a}\right) + \left(\frac{\frac{3}{2}}{b}\right))_*}}{a}\\ \end{array}\]

Runtime

Time bar (total: 24.3s)Debug logProfile

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