Average Error: 33.7 → 6.9
Time: 59.8s
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 -7.441879800942857 \cdot 10^{+133}:\\ \;\;\;\;(\frac{-2}{3} \cdot \left(\frac{b}{a}\right) + \left(\frac{c}{\frac{b}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b \le -4.761061425030245 \cdot 10^{-252}:\\ \;\;\;\;\frac{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} + \left(-b\right)}{3}}{a}\\ \mathbf{elif}\;b \le 1.6432415629711115 \cdot 10^{+81}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{(a \cdot \left(c \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 < -7.441879800942857e+133

    1. Initial program 54.2

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

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

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

    if -7.441879800942857e+133 < b < -4.761061425030245e-252

    1. Initial program 8.3

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

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

    if -4.761061425030245e-252 < b < 1.6432415629711115e+81

    1. Initial program 29.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 flip-+29.9

      \[\leadsto \frac{\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}}}}{3 \cdot a}\]
    4. Applied associate-/l/35.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(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
    5. Simplified22.4

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

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

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

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

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

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

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

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

    if 1.6432415629711115e+81 < b

    1. Initial program 57.7

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

      \[\leadsto \frac{\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}}}}{3 \cdot a}\]
    4. Applied associate-/l/58.0

      \[\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(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
    5. Simplified30.5

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -7.441879800942857 \cdot 10^{+133}:\\ \;\;\;\;(\frac{-2}{3} \cdot \left(\frac{b}{a}\right) + \left(\frac{c}{\frac{b}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b \le -4.761061425030245 \cdot 10^{-252}:\\ \;\;\;\;\frac{\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} + \left(-b\right)}{3}}{a}\\ \mathbf{elif}\;b \le 1.6432415629711115 \cdot 10^{+81}:\\ \;\;\;\;\frac{c}{\left(-b\right) - \sqrt{(a \cdot \left(c \cdot -3\right) + \left(b \cdot b\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(-b\right) - b}\\ \end{array}\]

Runtime

Time bar (total: 59.8s)Debug logProfile

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