Average Error: 34.0 → 6.0
Time: 12.7s
Precision: 64
Internal precision: 2688
\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -1.6573860688298954 \cdot 10^{+150}:\\ \;\;\;\;\frac{c}{\frac{c \cdot \frac{1}{2}}{\frac{b/2}{a}} - \left(b/2 + b/2\right)}\\ \mathbf{if}\;b/2 \le 2.105619749513626 \cdot 10^{-237}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{{b/2}^2 - c \cdot a} + \left(-b/2\right)}{c}}\\ \mathbf{if}\;b/2 \le 7.666985785588564 \cdot 10^{+91}:\\ \;\;\;\;\frac{-b/2}{a} - \frac{\sqrt{{b/2}^2 - a \cdot c}}{a}\\ \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 4 regimes.
  2. if b/2 < -1.6573860688298954e+150

    1. Initial program 62.6

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

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

      \[\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 clear-num 39.0

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

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

      \[\leadsto \frac{1}{\frac{\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - 2 \cdot b/2}{c}}\]
    9. Taylor expanded around -inf 9.0

      \[\leadsto \frac{1}{\frac{\color{blue}{\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - 2 \cdot b/2}}{c}}\]
    10. Applied simplify 0.5

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

    if -1.6573860688298954e+150 < b/2 < 2.105619749513626e-237

    1. Initial program 32.6

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

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

      \[\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 clear-num 16.3

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

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

    if 2.105619749513626e-237 < b/2 < 7.666985785588564e+91

    1. Initial program 8.7

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

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

    if 7.666985785588564e+91 < b/2

    1. Initial program 45.1

      \[\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 4 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 12.7s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1066372953 114334025 411438303 1288252006 2962405338 2829794477)'
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))