Average Error: 33.9 → 10.2
Time: 18.3s
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 -2.451147907148018 \cdot 10^{+91}:\\ \;\;\;\;(\frac{-2}{3} \cdot \left(\frac{b}{a}\right) + \left(\frac{c}{\frac{b}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b \le 3.7433041077163983 \cdot 10^{-41}:\\ \;\;\;\;\frac{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*}}{a}}{3} - \frac{\frac{b}{a}}{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot \frac{-1}{2}\\ \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 < -2.451147907148018e+91

    1. Initial program 42.6

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

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

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

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

    if -2.451147907148018e+91 < b < 3.7433041077163983e-41

    1. Initial program 14.4

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*} - b}{a}}{3}}\]
    9. Using strategy rm
    10. Applied div-sub14.4

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*}}{a} - \frac{b}{a}}}{3}\]
    11. Applied div-sub14.4

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

    if 3.7433041077163983e-41 < b

    1. Initial program 54.6

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

      \[\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.451147907148018 \cdot 10^{+91}:\\ \;\;\;\;(\frac{-2}{3} \cdot \left(\frac{b}{a}\right) + \left(\frac{c}{\frac{b}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b \le 3.7433041077163983 \cdot 10^{-41}:\\ \;\;\;\;\frac{\frac{\sqrt{(\left(a \cdot -3\right) \cdot c + \left(b \cdot b\right))_*}}{a}}{3} - \frac{\frac{b}{a}}{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot \frac{-1}{2}\\ \end{array}\]

Runtime

Time bar (total: 18.3s)Debug logProfile

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