Average Error: 33.3 → 7.1
Time: 2.0m
Precision: 64
Internal Precision: 3456
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;b \le -2.613229441070947 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{c}{b}}{1} - \frac{b}{a}\\ \mathbf{if}\;b \le 1.0646373318657837 \cdot 10^{-235}:\\ \;\;\;\;\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}\\ \mathbf{if}\;b \le 5.067434456677446 \cdot 10^{+102}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{4 \cdot c}{\left(-b\right) - \left(\sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}} \cdot \sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}}\right) \cdot \sqrt[3]{\left|\sqrt[3]{b \cdot b - 4 \cdot \left(a \cdot c\right)}\right| \cdot \sqrt{\sqrt[3]{b \cdot b - \left(a \cdot 4\right) \cdot c}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{4 \cdot c}{2}}{\frac{a}{b} \cdot \left(c + c\right) + \left(\left(-b\right) - b\right)}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Split input into 4 regimes
  2. if b < -2.613229441070947e+45

    1. Initial program 36.4

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

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}{2 \cdot a}\]
    3. Applied simplify5.8

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

    if -2.613229441070947e+45 < b < 1.0646373318657837e-235

    1. Initial program 10.2

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

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

    if 1.0646373318657837e-235 < b < 5.067434456677446e+102

    1. Initial program 34.7

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
    4. Applied simplify15.9

      \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity15.9

      \[\leadsto \frac{\color{blue}{1 \cdot \frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
    7. Applied times-frac15.9

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}}\]
    8. Applied simplify7.5

      \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{4 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}}}\]
    9. Using strategy rm
    10. Applied add-cube-cbrt8.3

      \[\leadsto \frac{1}{2} \cdot \frac{4 \cdot c}{\left(-b\right) - \color{blue}{\left(\sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}} \cdot \sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}}\right) \cdot \sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}}}}\]
    11. Using strategy rm
    12. Applied add-cube-cbrt8.2

      \[\leadsto \frac{1}{2} \cdot \frac{4 \cdot c}{\left(-b\right) - \left(\sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}} \cdot \sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}}\right) \cdot \sqrt[3]{\sqrt{\color{blue}{\left(\sqrt[3]{b \cdot b - \left(a \cdot 4\right) \cdot c} \cdot \sqrt[3]{b \cdot b - \left(a \cdot 4\right) \cdot c}\right) \cdot \sqrt[3]{b \cdot b - \left(a \cdot 4\right) \cdot c}}}}}\]
    13. Applied sqrt-prod8.2

      \[\leadsto \frac{1}{2} \cdot \frac{4 \cdot c}{\left(-b\right) - \left(\sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}} \cdot \sqrt[3]{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c}}\right) \cdot \sqrt[3]{\color{blue}{\sqrt{\sqrt[3]{b \cdot b - \left(a \cdot 4\right) \cdot c} \cdot \sqrt[3]{b \cdot b - \left(a \cdot 4\right) \cdot c}} \cdot \sqrt{\sqrt[3]{b \cdot b - \left(a \cdot 4\right) \cdot c}}}}}\]
    14. Applied simplify8.2

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

    if 5.067434456677446e+102 < b

    1. Initial program 58.4

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

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

      \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity33.0

      \[\leadsto \frac{\color{blue}{1 \cdot \frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
    7. Applied times-frac33.0

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}}\]
    8. Applied simplify30.9

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

      \[\leadsto \frac{1}{2} \cdot \frac{4 \cdot c}{\left(-b\right) - \color{blue}{\left(b - 2 \cdot \frac{c \cdot a}{b}\right)}}\]
    10. Applied simplify2.7

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

Runtime

Time bar (total: 2.0m)Debug logProfile

herbie shell --seed '#(1064397287 3527694221 3797617954 1138343853 2854031332 1153838279)' 
(FPCore (a b c)
  :name "Quadratic roots, full range"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))