Average Error: 33.7 → 11.6
Time: 42.9s
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 -2.2673540435462902 \cdot 10^{+135}:\\ \;\;\;\;\frac{\frac{-2}{3} \cdot b}{a}\\ \mathbf{elif}\;b \le 3.9654670174011694 \cdot 10^{-240}:\\ \;\;\;\;\frac{1}{\frac{a \cdot 3}{\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}\\ \mathbf{elif}\;b \le 8.948672254909119 \cdot 10^{+56}:\\ \;\;\;\;\frac{\frac{a}{\left(-b\right) - \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}} \cdot c}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot a}{(-2 \cdot b + \left(\left(c \cdot a\right) \cdot \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 < -2.2673540435462902e+135

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

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

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

    if -2.2673540435462902e+135 < b < 3.9654670174011694e-240

    1. Initial program 10.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 *-un-lft-identity10.1

      \[\leadsto \frac{\left(-b\right) + \color{blue}{1 \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
    4. Applied *-un-lft-identity10.1

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

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

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

    if 3.9654670174011694e-240 < b < 8.948672254909119e+56

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

      \[\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 flip-+32.8

      \[\leadsto \frac{\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}}{a}\]
    6. Applied associate-/l/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}}{3 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{a}\]
    7. Simplified18.2

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

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

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

      \[\leadsto \frac{1 \cdot \color{blue}{\frac{c \cdot a}{\left(-b\right) - \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}}}{a}\]
    12. Using strategy rm
    13. Applied *-un-lft-identity18.1

      \[\leadsto \frac{1 \cdot \frac{c \cdot a}{\left(-b\right) - \color{blue}{1 \cdot \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}}}{a}\]
    14. Applied *-un-lft-identity18.1

      \[\leadsto \frac{1 \cdot \frac{c \cdot a}{\color{blue}{1 \cdot \left(-b\right)} - 1 \cdot \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}}{a}\]
    15. Applied distribute-lft-out--18.1

      \[\leadsto \frac{1 \cdot \frac{c \cdot a}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}\right)}}}{a}\]
    16. Applied times-frac14.8

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

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

    if 8.948672254909119e+56 < b

    1. Initial program 56.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*56.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 flip-+56.5

      \[\leadsto \frac{\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}}{a}\]
    6. Applied associate-/l/56.5

      \[\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}}{3 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{a}\]
    7. Simplified28.2

      \[\leadsto \frac{\frac{\color{blue}{3 \cdot \left(c \cdot a\right)}}{3 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{a}\]
    8. Using strategy rm
    9. Applied times-frac28.2

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

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

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

      \[\leadsto \frac{1 \cdot \frac{c \cdot a}{\color{blue}{\frac{3}{2} \cdot \frac{a \cdot c}{b} - 2 \cdot b}}}{a}\]
    13. Simplified14.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -2.2673540435462902 \cdot 10^{+135}:\\ \;\;\;\;\frac{\frac{-2}{3} \cdot b}{a}\\ \mathbf{elif}\;b \le 3.9654670174011694 \cdot 10^{-240}:\\ \;\;\;\;\frac{1}{\frac{a \cdot 3}{\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}\\ \mathbf{elif}\;b \le 8.948672254909119 \cdot 10^{+56}:\\ \;\;\;\;\frac{\frac{a}{\left(-b\right) - \sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}} \cdot c}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c \cdot a}{(-2 \cdot b + \left(\left(c \cdot a\right) \cdot \frac{\frac{3}{2}}{b}\right))_*}}{a}\\ \end{array}\]

Runtime

Time bar (total: 42.9s)Debug logProfile

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