Average Error: 34.5 → 18.5
Time: 25.5s
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 5.106436903424975 \cdot 10^{-284}:\\ \;\;\;\;\frac{1}{3 \cdot a} \cdot \left(\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} - b\right)\\ \mathbf{elif}\;b \le 3.911789772911833 \cdot 10^{+79}:\\ \;\;\;\;\frac{\frac{a \cdot -3}{\frac{\left(b + \sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*}\right) \cdot 3}{c}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(a \cdot -3\right) \cdot c}{\left(b + b\right) \cdot 3}}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Split input into 3 regimes
  2. if b < 5.106436903424975e-284

    1. Initial program 22.6

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

      \[\leadsto \frac{\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}\]
    3. Taylor expanded around 0 22.7

      \[\leadsto \frac{\sqrt{\color{blue}{{b}^{2} - 3 \cdot \left(a \cdot c\right)}} - b}{3 \cdot a}\]
    4. Simplified22.6

      \[\leadsto \frac{\sqrt{\color{blue}{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*}} - b}{3 \cdot a}\]
    5. Using strategy rm
    6. Applied div-inv22.7

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

    if 5.106436903424975e-284 < b < 3.911789772911833e+79

    1. Initial program 33.0

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

      \[\leadsto \frac{\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}\]
    3. Taylor expanded around 0 33.0

      \[\leadsto \frac{\sqrt{\color{blue}{{b}^{2} - 3 \cdot \left(a \cdot c\right)}} - b}{3 \cdot a}\]
    4. Simplified33.0

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} - b}{3}}{a}}\]
    7. Using strategy rm
    8. Applied flip--33.1

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

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} - b \cdot b}{3 \cdot \left(\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    10. Simplified17.0

      \[\leadsto \frac{\frac{\color{blue}{\left(a \cdot -3\right) \cdot c}}{3 \cdot \left(\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    11. Using strategy rm
    12. Applied associate-/l*14.9

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

    if 3.911789772911833e+79 < b

    1. Initial program 58.0

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

      \[\leadsto \frac{\sqrt{(-3 \cdot \left(c \cdot a\right) + \left(b \cdot b\right))_*} - b}{3 \cdot a}\]
    3. Taylor expanded around 0 58.0

      \[\leadsto \frac{\sqrt{\color{blue}{{b}^{2} - 3 \cdot \left(a \cdot c\right)}} - b}{3 \cdot a}\]
    4. Simplified58.0

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} - b}{3}}{a}}\]
    7. Using strategy rm
    8. Applied flip--58.1

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

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} \cdot \sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} - b \cdot b}{3 \cdot \left(\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} + b\right)}}}{a}\]
    10. Simplified30.9

      \[\leadsto \frac{\frac{\color{blue}{\left(a \cdot -3\right) \cdot c}}{3 \cdot \left(\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} + b\right)}}{a}\]
    11. Taylor expanded around 0 15.0

      \[\leadsto \frac{\frac{\left(a \cdot -3\right) \cdot c}{3 \cdot \left(\color{blue}{b} + b\right)}}{a}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification18.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le 5.106436903424975 \cdot 10^{-284}:\\ \;\;\;\;\frac{1}{3 \cdot a} \cdot \left(\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} - b\right)\\ \mathbf{elif}\;b \le 3.911789772911833 \cdot 10^{+79}:\\ \;\;\;\;\frac{\frac{a \cdot -3}{\frac{\left(b + \sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*}\right) \cdot 3}{c}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(a \cdot -3\right) \cdot c}{\left(b + b\right) \cdot 3}}{a}\\ \end{array}\]

Runtime

Time bar (total: 25.5s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes32.018.515.816.283%
herbie shell --seed 2018354 +o rules:numerics
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))