Average Error: 33.6 → 11.1
Time: 31.5s
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 -6.472873211714348 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b} - \frac{b}{a} \cdot \frac{2}{3}\\ \mathbf{elif}\;b \le 4.4690311428783294 \cdot 10^{-172}:\\ \;\;\;\;\frac{\sqrt{\left(-3 \cdot a\right) \cdot c + b \cdot b} - b}{a \cdot 3}\\ \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 < -6.472873211714348e+79

    1. Initial program 41.1

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

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

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

    if -6.472873211714348e+79 < b < 4.4690311428783294e-172

    1. Initial program 10.8

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

      \[\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 *-un-lft-identity10.9

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

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

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

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

    if 4.4690311428783294e-172 < b

    1. Initial program 48.9

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

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

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

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

Runtime

Time bar (total: 31.5s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes33.611.15.727.880.6%
herbie shell --seed 2018263 
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))