Average Error: 33.1 → 9.5
Time: 54.7s
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}\;\frac{\frac{-1}{2}}{b_2} \le -4.1193638536823104 \cdot 10^{+54}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\\ \mathbf{if}\;\frac{\frac{-1}{2}}{b_2} \le 6.294126429122108 \cdot 10^{-304}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{if}\;\frac{\frac{-1}{2}}{b_2} \le 2.9347032155101205 \cdot 10^{-146}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{b_2} - \left(\frac{b_2}{a} + \frac{b_2}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \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 (/ -1/2 b_2) < -4.1193638536823104e+54

    1. Initial program 20.6

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

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

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

    if -4.1193638536823104e+54 < (/ -1/2 b_2) < 6.294126429122108e-304

    1. Initial program 53.1

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

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

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

    if 6.294126429122108e-304 < (/ -1/2 b_2) < 2.9347032155101205e-146

    1. Initial program 57.6

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

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

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

    if 2.9347032155101205e-146 < (/ -1/2 b_2)

    1. Initial program 8.5

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 54.7s)Debug logProfile

herbie shell --seed '#(1071821486 549052472 3784827256 1559736200 3548510075 881134285)' 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))