Average Error: 33.4 → 8.7
Time: 57.5s
Precision: 64
Internal Precision: 3392
\[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -1.180819239099574 \cdot 10^{+88}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \mathbf{if}\;b_2 \le 5.7886576392361 \cdot 10^{-129}:\\ \;\;\;\;\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\\ \mathbf{if}\;b_2 \le 1.9702676758824543 \cdot 10^{+51}:\\ \;\;\;\;\frac{1}{\frac{a}{\frac{c \cdot \left(-a\right)}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \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 < -1.180819239099574e+88

    1. Initial program 42.4

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

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

    if -1.180819239099574e+88 < b_2 < 5.7886576392361e-129

    1. Initial program 11.2

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    4. Applied simplify11.3

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]

    if 5.7886576392361e-129 < b_2 < 1.9702676758824543e+51

    1. Initial program 38.8

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    4. Applied simplify38.9

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    5. Using strategy rm
    6. Applied flip--39.0

      \[\leadsto \frac{1}{\frac{a}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}}}\]
    7. Applied simplify16.5

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

    if 1.9702676758824543e+51 < b_2

    1. Initial program 56.4

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

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b_2}}}{a}\]
    3. Applied simplify3.8

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b_2}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 57.5s)Debug logProfile

herbie shell --seed '#(1071948828 1180510430 2986424009 997076509 406109801 420189285)' 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))