Average Error: 33.3 → 7.4
Time: 55.7s
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 -2.817036323587252 \cdot 10^{+75}:\\ \;\;\;\;(\frac{-2}{3} \cdot \left(\frac{b}{a}\right) + \left(\frac{c}{\frac{b}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b \le 1.6112526981926432 \cdot 10^{-298}:\\ \;\;\;\;\frac{1}{a \cdot 3} \cdot \left(\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} + \left(-b\right)\right)\\ \mathbf{elif}\;b \le 9.940268438132398 \cdot 10^{+42}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{(c \cdot \left(a \cdot -3\right) + \left(b \cdot b\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(-b\right) - b}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Split input into 4 regimes
  2. if b < -2.817036323587252e+75

    1. Initial program 39.8

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied div-inv39.9

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

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

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

    if -2.817036323587252e+75 < b < 1.6112526981926432e-298

    1. Initial program 9.8

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied div-inv9.9

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

    if 1.6112526981926432e-298 < b < 9.940268438132398e+42

    1. Initial program 29.2

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied div-inv29.3

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{3 \cdot \left(c \cdot a\right)}{a \cdot 3}}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity17.3

      \[\leadsto \frac{\frac{3 \cdot \left(c \cdot a\right)}{a \cdot 3}}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
    10. Applied *-un-lft-identity17.3

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

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

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

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

    if 9.940268438132398e+42 < b

    1. Initial program 56.2

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied div-inv56.2

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{3 \cdot \left(c \cdot a\right)}{a \cdot 3}}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity27.1

      \[\leadsto \frac{\frac{3 \cdot \left(c \cdot a\right)}{a \cdot 3}}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
    10. Applied *-un-lft-identity27.1

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -2.817036323587252 \cdot 10^{+75}:\\ \;\;\;\;(\frac{-2}{3} \cdot \left(\frac{b}{a}\right) + \left(\frac{c}{\frac{b}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b \le 1.6112526981926432 \cdot 10^{-298}:\\ \;\;\;\;\frac{1}{a \cdot 3} \cdot \left(\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} + \left(-b\right)\right)\\ \mathbf{elif}\;b \le 9.940268438132398 \cdot 10^{+42}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{(c \cdot \left(a \cdot -3\right) + \left(b \cdot b\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(-b\right) - b}\\ \end{array}\]

Runtime

Time bar (total: 55.7s)Debug logProfile

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