Average Error: 33.9 → 8.8
Time: 2.1m
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 -9.243181273132067 \cdot 10^{+153}:\\ \;\;\;\;\frac{\frac{\frac{3}{2} \cdot a}{\frac{b}{c}} - \left(b + b\right)}{a \cdot 3}\\ \mathbf{if}\;b \le 3.614970159987374 \cdot 10^{-149}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{if}\;b \le 232.00347698157512:\\ \;\;\;\;\frac{\frac{c \cdot \left(a \cdot 3\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{\frac{3}{2} \cdot c}{\frac{b}{a}} - 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 < -9.243181273132067e+153

    1. Initial program 60.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 *-un-lft-identity60.9

      \[\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-frac60.9

      \[\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 simplify60.9

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

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

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

    if -9.243181273132067e+153 < b < 3.614970159987374e-149

    1. Initial program 10.5

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

    if 3.614970159987374e-149 < b < 232.00347698157512

    1. Initial program 35.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-+35.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 simplify17.6

      \[\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}\]

    if 232.00347698157512 < 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 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 16.2

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

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

Runtime

Time bar (total: 2.1m)Debug logProfile

herbie shell --seed '#(1071215679 2002590028 935158157 1944352234 2656991306 2955288481)' 
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))