Average Error: 33.4 → 7.2
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}\;b \le -1.9758144017797662 \cdot 10^{+81}:\\ \;\;\;\;\frac{b}{\frac{-3}{2} \cdot a}\\ \mathbf{if}\;b \le -1.1200099492796014 \cdot 10^{-308}:\\ \;\;\;\;\frac{\frac{\sqrt{(\left(-3\right) \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{3}}{a}\\ \mathbf{if}\;b \le 2.0644225467610084 \cdot 10^{+18}:\\ \;\;\;\;\frac{3}{3} \cdot \frac{c}{\left(-b\right) - \sqrt{(\left(-c\right) \cdot \left(3 \cdot a\right) + \left(b \cdot b\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(\sqrt[3]{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}}} \cdot \sqrt[3]{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}}}\right) \cdot \sqrt[3]{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}}} - 2 \cdot b}\\ \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 < -1.9758144017797662e+81

    1. Initial program 40.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-+61.0

      \[\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 simplify61.2

      \[\leadsto \frac{\frac{\color{blue}{3 \cdot \left(c \cdot a\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-identity61.2

      \[\leadsto \frac{\frac{3 \cdot \left(c \cdot a\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-frac61.2

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

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

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

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

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

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

    if -1.9758144017797662e+81 < b < -1.1200099492796014e-308

    1. Initial program 8.6

      \[\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*8.7

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

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

    if -1.1200099492796014e-308 < b < 2.0644225467610084e+18

    1. Initial program 28.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 flip-+28.3

      \[\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 simplify18.1

      \[\leadsto \frac{\frac{\color{blue}{3 \cdot \left(c \cdot a\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-identity18.1

      \[\leadsto \frac{\frac{3 \cdot \left(c \cdot a\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-frac18.2

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

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

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

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

    if 2.0644225467610084e+18 < b

    1. Initial program 55.3

      \[\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-+55.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 simplify28.1

      \[\leadsto \frac{\frac{\color{blue}{3 \cdot \left(c \cdot a\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-identity28.1

      \[\leadsto \frac{\frac{3 \cdot \left(c \cdot a\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-frac28.1

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c}{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}} - 2 \cdot b}}\]
    13. Using strategy rm
    14. Applied add-cube-cbrt5.0

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

Runtime

Time bar (total: 2.5m)Debug logProfile

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