Average Error: 33.5 → 9.3
Time: 51.2s
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 -2.7887640869868202 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{1}{2}}{\frac{b/2}{c}} - b/2 \cdot \frac{2}{a}\\ \mathbf{if}\;b/2 \le 1.3310796105836453 \cdot 10^{-210}:\\ \;\;\;\;\frac{(\left(\sqrt[3]{-b/2} \cdot \sqrt[3]{-b/2}\right) \cdot \left(\sqrt[3]{-b/2}\right) + \left(\sqrt{b/2 \cdot b/2 - a \cdot c}\right))_*}{a}\\ \mathbf{if}\;b/2 \le 4.1096217777624155 \cdot 10^{+104}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot c}{\frac{b/2}{a}} - \left(b/2 + 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 < -2.7887640869868202e+101

    1. Initial program 44.9

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

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

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

    if -2.7887640869868202e+101 < b/2 < 1.3310796105836453e-210

    1. Initial program 10.8

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

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

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

    if 1.3310796105836453e-210 < b/2 < 4.1096217777624155e+104

    1. Initial program 36.0

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

      \[\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 simplify16.4

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

    if 4.1096217777624155e+104 < b/2

    1. Initial program 59.4

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

      \[\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.9

      \[\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 14.7

      \[\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.2

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

Runtime

Time bar (total: 51.2s)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' +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))