Average Error: 33.9 → 10.2
Time: 27.8s
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.506952361327566 \cdot 10^{+133}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b} - \frac{b}{a} \cdot \frac{2}{3}\\ \mathbf{elif}\;b \le 4.1086619461391636 \cdot 10^{-101}:\\ \;\;\;\;\frac{\frac{\sqrt{\left(-3 \cdot a\right) \cdot c + b \cdot b} - b}{3}}{a}\\ \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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if b < -2.506952361327566e+133

    1. Initial program 53.5

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

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

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

    if -2.506952361327566e+133 < b < 4.1086619461391636e-101

    1. Initial program 12.1

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied associate-/r*12.1

      \[\leadsto \color{blue}{\frac{\frac{\left(-b\right) + \sqrt{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}{3}}{a}}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity12.1

      \[\leadsto \frac{\frac{\left(-b\right) + \color{blue}{1 \cdot \sqrt{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}}{3}}{a}\]
    7. Applied *-un-lft-identity12.1

      \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(-b\right)} + 1 \cdot \sqrt{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}{3}}{a}\]
    8. Applied distribute-lft-out12.1

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

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

    if 4.1086619461391636e-101 < b

    1. Initial program 51.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -2.506952361327566 \cdot 10^{+133}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b} - \frac{b}{a} \cdot \frac{2}{3}\\ \mathbf{elif}\;b \le 4.1086619461391636 \cdot 10^{-101}:\\ \;\;\;\;\frac{\frac{\sqrt{\left(-3 \cdot a\right) \cdot c + b \cdot b} - b}{3}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b}\\ \end{array}\]

Runtime

Time bar (total: 27.8s)Debug logProfile

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