Average Error: 33.7 → 16.2
Time: 29.7s
Precision: 64
Internal Precision: 128
\[\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 -8.031695739489305 \cdot 10^{+163}:\\ \;\;\;\;\frac{\frac{3}{2} \cdot \frac{a \cdot c}{b} - 2 \cdot b}{a \cdot 3}\\ \mathbf{elif}\;b \le 8.368221583689143 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + \left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-3}{2} \cdot \frac{a \cdot c}{b}}{a \cdot 3}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if b < -8.031695739489305e+163

    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 add-sqr-sqrt60.9

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

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

    if -8.031695739489305e+163 < b < 8.368221583689143e-75

    1. Initial program 13.6

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Initial simplification13.6

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

    if 8.368221583689143e-75 < b

    1. Initial program 52.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -8.031695739489305 \cdot 10^{+163}:\\ \;\;\;\;\frac{\frac{3}{2} \cdot \frac{a \cdot c}{b} - 2 \cdot b}{a \cdot 3}\\ \mathbf{elif}\;b \le 8.368221583689143 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + \left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-3}{2} \cdot \frac{a \cdot c}{b}}{a \cdot 3}\\ \end{array}\]

Runtime

Time bar (total: 29.7s)Debug logProfile

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