Average Error: 34.1 → 5.7
Time: 12.1s
Precision: 64
Internal precision: 2432
\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -5.70520821627162 \cdot 10^{+104}:\\ \;\;\;\;\frac{c}{\left(a \cdot \frac{1}{2}\right) \cdot \frac{c}{b/2} + \left(\left(-b/2\right) - b/2\right)}\\ \mathbf{if}\;b/2 \le 1.912797832812561 \cdot 10^{-298}:\\ \;\;\;\;\frac{\frac{c}{1}}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}\\ \mathbf{if}\;b/2 \le 2.8184599889584243 \cdot 10^{+148}:\\ \;\;\;\;\frac{\left(-b/2\right) - \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 < -5.70520821627162e+104

    1. Initial program 59.1

      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip-- 59.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 33.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 *-un-lft-identity 33.0

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

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

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

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

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

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

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

    if -5.70520821627162e+104 < b/2 < 1.912797832812561e-298

    1. Initial program 31.7

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

      \[\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.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 *-un-lft-identity 15.8

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

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

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

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

    if 1.912797832812561e-298 < b/2 < 2.8184599889584243e+148

    1. Initial program 8.7

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

    if 2.8184599889584243e+148 < b/2

    1. Initial program 59.6

      \[\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.1s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1066500295 745726447 3908002351 725592315 4114972361 2368915013)'
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))