Average Error: 33.1 → 9.3
Time: 30.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 -4.882000605519973 \cdot 10^{+110}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot \frac{-3}{2}}\\ \mathbf{elif}\;b \le 5.604056554511522 \cdot 10^{-236}:\\ \;\;\;\;\frac{1}{\frac{3}{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a}}}\\ \mathbf{elif}\;b \le 3.702161225485661 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{\left(a \cdot 3\right) \cdot \left(-c\right)}{\left(\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} + b\right) \cdot 3}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c}}\\ \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 < -4.882000605519973e+110

    1. Initial program 48.4

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

      \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied clear-num48.4

      \[\leadsto \color{blue}{\frac{1}{\frac{3 \cdot a}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}}}\]
    5. Using strategy rm
    6. Applied associate-/l*48.4

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

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

    if -4.882000605519973e+110 < b < 5.604056554511522e-236

    1. Initial program 9.8

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

      \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied clear-num9.9

      \[\leadsto \color{blue}{\frac{1}{\frac{3 \cdot a}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}}}\]
    5. Using strategy rm
    6. Applied associate-/l*9.9

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

    if 5.604056554511522e-236 < b < 3.702161225485661e+98

    1. Initial program 34.7

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

      \[\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*34.7

      \[\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--34.8

      \[\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/34.8

      \[\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. Simplified16.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.702161225485661e+98 < b

    1. Initial program 58.7

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

      \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\]
    3. Using strategy rm
    4. Applied clear-num58.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -4.882000605519973 \cdot 10^{+110}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot \frac{-3}{2}}\\ \mathbf{elif}\;b \le 5.604056554511522 \cdot 10^{-236}:\\ \;\;\;\;\frac{1}{\frac{3}{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a}}}\\ \mathbf{elif}\;b \le 3.702161225485661 \cdot 10^{+98}:\\ \;\;\;\;\frac{\frac{\left(a \cdot 3\right) \cdot \left(-c\right)}{\left(\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} + b\right) \cdot 3}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b}{c}}\\ \end{array}\]

Runtime

Time bar (total: 30.8s)Debug logProfile

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