Average Error: 34.9 → 7.4
Time: 16.0s
Precision: 64
Internal precision: 2944
\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -9.534865642779829 \cdot 10^{+39}:\\ \;\;\;\;\frac{c}{\frac{c}{b/2} \cdot \left(\frac{1}{2} \cdot a\right) - \left(b/2 - \left(-b/2\right)\right)}\\ \mathbf{if}\;b/2 \le -3.6019808479897 \cdot 10^{-63}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a}\\ \mathbf{if}\;b/2 \le -3.3498534903732907 \cdot 10^{-77}:\\ \;\;\;\;\frac{c}{\frac{c}{b/2} \cdot \left(\frac{1}{2} \cdot a\right) - \left(b/2 - \left(-b/2\right)\right)}\\ \mathbf{if}\;b/2 \le 2.479231526661392 \cdot 10^{+104}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b/2}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b/2

Bits error versus c

Derivation

  1. Split input into 5 regimes.
  2. if b/2 < -9.534865642779829e+39

    1. Initial program 58.2

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied div-inv 31.8

      \[\leadsto \color{blue}{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}} \cdot \frac{1}{a}}\]
    7. Applied taylor 14.6

      \[\leadsto \frac{c \cdot a}{\left(-b/2\right) + \left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)} \cdot \frac{1}{a}\]
    8. Taylor expanded around -inf 14.6

      \[\leadsto \frac{c \cdot a}{\left(-b/2\right) + \color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)}} \cdot \frac{1}{a}\]
    9. Applied simplify 1.9

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

    if -9.534865642779829e+39 < b/2 < -3.6019808479897e-63

    1. Initial program 43.1

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

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

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

    if -3.6019808479897e-63 < b/2 < -3.3498534903732907e-77

    1. Initial program 60.3

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied div-inv 49.9

      \[\leadsto \color{blue}{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}} \cdot \frac{1}{a}}\]
    7. Applied taylor 16.0

      \[\leadsto \frac{c \cdot a}{\left(-b/2\right) + \left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)} \cdot \frac{1}{a}\]
    8. Taylor expanded around -inf 16.0

      \[\leadsto \frac{c \cdot a}{\left(-b/2\right) + \color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)}} \cdot \frac{1}{a}\]
    9. Applied simplify 10.2

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

    if -3.3498534903732907e-77 < b/2 < 2.479231526661392e+104

    1. Initial program 12.2

      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied clear-num 12.4

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

    if 2.479231526661392e+104 < b/2

    1. Initial program 46.5

      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
    2. Applied taylor 0

      \[\leadsto -2 \cdot \frac{b/2}{a}\]
    3. Taylor expanded around inf 0

      \[\leadsto \color{blue}{-2 \cdot \frac{b/2}{a}}\]
  3. Recombined 5 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 16.0s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1065003094 2074156664 2352254222 753858891 3745550101 3374585842)'
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))