Average Error: 33.8 → 11.4
Time: 27.0s
Precision: 64
Internal Precision: 3136
\[\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.60740488128834 \cdot 10^{+132}:\\ \;\;\;\;\frac{\frac{-2}{3} \cdot b}{a}\\ \mathbf{elif}\;b \le 1.4134533938325374 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{3}}{a}\\ \mathbf{elif}\;b \le 3.817857663341454 \cdot 10^{+109}:\\ \;\;\;\;\frac{\frac{\left(-c\right) \cdot \left(a \cdot 3\right)}{3 \cdot \left(\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} + b\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{c \cdot a}{b} \cdot \frac{-3}{2}}{3}}{a}\\ \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 4 regimes
  2. if b < -3.60740488128834e+132

    1. Initial program 53.5

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

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

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

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

    if -3.60740488128834e+132 < b < 1.4134533938325374e-148

    1. Initial program 10.9

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

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

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

    if 1.4134533938325374e-148 < b < 3.817857663341454e+109

    1. Initial program 39.4

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3}}{a}}\]
    5. Using strategy rm
    6. Applied flip--39.4

      \[\leadsto \frac{\frac{\color{blue}{\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b \cdot b}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + b}}}{3}}{a}\]
    7. Applied associate-/l/39.5

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

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

    if 3.817857663341454e+109 < b

    1. Initial program 59.5

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -3.60740488128834 \cdot 10^{+132}:\\ \;\;\;\;\frac{\frac{-2}{3} \cdot b}{a}\\ \mathbf{elif}\;b \le 1.4134533938325374 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{3}}{a}\\ \mathbf{elif}\;b \le 3.817857663341454 \cdot 10^{+109}:\\ \;\;\;\;\frac{\frac{\left(-c\right) \cdot \left(a \cdot 3\right)}{3 \cdot \left(\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} + b\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{c \cdot a}{b} \cdot \frac{-3}{2}}{3}}{a}\\ \end{array}\]

Runtime

Time bar (total: 27.0s)Debug logProfile

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