Average Error: 33.6 → 12.8
Time: 1.8m
Precision: 64
Internal Precision: 3200
\[\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 3.0809300649606236 \cdot 10^{-288}:\\ \;\;\;\;\frac{\sqrt{(c \cdot \left(-3 \cdot a\right) + \left(b \cdot b\right))_*}}{3 \cdot a} - \frac{b}{3 \cdot a}\\ \mathbf{if}\;b \le 7.304530258043564 \cdot 10^{+106}:\\ \;\;\;\;\frac{1}{3} \cdot \frac{c \cdot -3}{\sqrt{(c \cdot \left(-3 \cdot a\right) + \left(b \cdot b\right))_*} + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{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 3 regimes
  2. if b < 3.0809300649606236e-288

    1. Initial program 21.0

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Applied simplify21.0

      \[\leadsto \color{blue}{\frac{\sqrt{(c \cdot \left(-3 \cdot a\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}}\]
    3. Using strategy rm
    4. Applied div-sub21.0

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

    if 3.0809300649606236e-288 < b < 7.304530258043564e+106

    1. Initial program 33.8

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Applied simplify33.8

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

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

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

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

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

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

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

    if 7.304530258043564e+106 < b

    1. Initial program 58.6

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Applied simplify58.7

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

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

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

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

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

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

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

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

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

Runtime

Time bar (total: 1.8m)Debug logProfile

herbie shell --seed '#(1070991898 1055468627 4280279443 640792587 928206309 3646738750)' +o rules:numerics
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))