Average Error: 33.7 → 7.5
Time: 2.4m
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.211770364202407 \cdot 10^{+85}:\\ \;\;\;\;\frac{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}} - \left(b + b\right)}{3 \cdot a}\\ \mathbf{if}\;b \le 1.506410430935662 \cdot 10^{-307}:\\ \;\;\;\;\frac{\sqrt{(\left(-c\right) \cdot \left(3 \cdot a\right) + \left(b \cdot b\right))_*} - b}{a} \cdot \frac{1}{3}\\ \mathbf{if}\;b \le 1.70406614912541 \cdot 10^{+26}:\\ \;\;\;\;\frac{3}{\sqrt[3]{\left(-b\right) - \sqrt[3]{\sqrt{(\left(-3\right) \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}} \cdot \left(\sqrt[3]{\sqrt{(\left(-3\right) \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt[3]{\sqrt{(\left(-3\right) \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}}\right)}} \cdot \frac{\frac{c}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}}}{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{(\left(a \cdot \frac{c}{b}\right) \cdot \frac{3}{2} + \left(\left(-b\right) - 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 < -2.211770364202407e+85

    1. Initial program 42.0

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Taylor expanded around -inf 11.0

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

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

    if -2.211770364202407e+85 < b < 1.506410430935662e-307

    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 *-un-lft-identity9.7

      \[\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}\]
    4. Applied times-frac9.8

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

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

    if 1.506410430935662e-307 < b < 1.70406614912541e+26

    1. Initial program 27.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 flip-+27.8

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

      \[\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 add-cube-cbrt17.8

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

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

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

      \[\leadsto \frac{\frac{c}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3} \cdot \color{blue}{\frac{3}{\sqrt[3]{\left(-b\right) - \sqrt{(\left(-3\right) \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*}}}}\]
    10. Using strategy rm
    11. Applied add-cube-cbrt10.7

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

    if 1.70406614912541e+26 < b

    1. Initial program 55.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-+55.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 simplify27.2

      \[\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 15.3

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

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

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b \le -2.211770364202407 \cdot 10^{+85}:\\ \;\;\;\;\frac{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}} - \left(b + b\right)}{3 \cdot a}\\ \mathbf{if}\;b \le 1.506410430935662 \cdot 10^{-307}:\\ \;\;\;\;\frac{\sqrt{(\left(-c\right) \cdot \left(3 \cdot a\right) + \left(b \cdot b\right))_*} - b}{a} \cdot \frac{1}{3}\\ \mathbf{if}\;b \le 1.70406614912541 \cdot 10^{+26}:\\ \;\;\;\;\frac{3}{\sqrt[3]{\left(-b\right) - \sqrt[3]{\sqrt{(\left(-3\right) \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}} \cdot \left(\sqrt[3]{\sqrt{(\left(-3\right) \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}} \cdot \sqrt[3]{\sqrt{(\left(-3\right) \cdot \left(a \cdot c\right) + \left(b \cdot b\right))_*}}\right)}} \cdot \frac{\frac{c}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}}}}{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{(\left(a \cdot \frac{c}{b}\right) \cdot \frac{3}{2} + \left(\left(-b\right) - b\right))_*}\\ \end{array}}\]

Runtime

Time bar (total: 2.4m)Debug logProfile

herbie shell --seed '#(1071979731 1496239409 439705970 2863295848 982327776 189749553)' +o rules:numerics
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))