Average Error: 33.4 → 6.7
Time: 1.4m
Precision: 64
Internal Precision: 3456
\[\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -5.511531814320624 \cdot 10^{+88}:\\ \;\;\;\;-2 \cdot \frac{b/2}{a}\\ \mathbf{if}\;b/2 \le 6.715556055215588 \cdot 10^{-275}:\\ \;\;\;\;\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\\ \mathbf{if}\;b/2 \le 3.5943991276572144 \cdot 10^{+105}:\\ \;\;\;\;\frac{\frac{c}{\sqrt[3]{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}} \cdot \sqrt[3]{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}}{\sqrt[3]{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(-b/2\right) + (\left(\frac{c}{b/2}\right) \cdot \left(\frac{1}{2} \cdot a\right) + \left(-b/2\right))_*}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b/2

Bits error versus c

Derivation

  1. Split input into 4 regimes
  2. if b/2 < -5.511531814320624e+88

    1. Initial program 41.4

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b/2}{a}}\]

    if -5.511531814320624e+88 < b/2 < 6.715556055215588e-275

    1. Initial program 8.9

      \[\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]

    if 6.715556055215588e-275 < b/2 < 3.5943991276572144e+105

    1. Initial program 33.7

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt16.6

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\left(\sqrt[3]{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}} \cdot \sqrt[3]{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}\right) \cdot \sqrt[3]{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}}}{a}\]
    7. Applied times-frac14.5

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

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

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

    if 3.5943991276572144e+105 < b/2

    1. Initial program 59.0

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Taylor expanded around inf 13.5

      \[\leadsto \frac{\frac{c \cdot a}{\left(-b/2\right) - \color{blue}{\left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}}}{a}\]
    6. Applied simplify2.5

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

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed '#(1070833653 108281690 3330367898 3632331308 3494323072 43156186)' +o rules:numerics
(FPCore (a b/2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))