Average Error: 34.7 → 6.7
Time: 25.7s
Precision: 64
Internal precision: 2944
\[\frac{\left(-b2\right) - \sqrt{b2 \cdot b2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b2 \le -4.930770214232589 \cdot 10^{+18}:\\ \;\;\;\;\frac{c}{\left(\frac{1}{2} \cdot c\right) \cdot \frac{a}{b2} - \left(b2 - \left(-b2\right)\right)}\\ \mathbf{if}\;b2 \le -4.4891519221511533 \cdot 10^{-128}:\\ \;\;\;\;\frac{\frac{c \cdot a}{{\left(\sqrt{\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}}\right)}^2}}{a}\\ \mathbf{if}\;b2 \le 4.983767219933664 \cdot 10^{+51}:\\ \;\;\;\;\frac{\left(-b2\right) - \sqrt{b2 \cdot b2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b2}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b2

Bits error versus c

Derivation

  1. Split input into 4 regimes.
  2. if b2 < -4.930770214232589e+18

    1. Initial program 57.2

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt 29.2

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

      \[\leadsto \frac{\frac{c \cdot a}{{\left(\sqrt{\left(-b2\right) + \left(\frac{1}{2} \cdot \frac{c \cdot a}{b2} - b2\right)}\right)}^2}}{a}\]
    8. Taylor expanded around -inf 13.6

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

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

    if -4.930770214232589e+18 < b2 < -4.4891519221511533e-128

    1. Initial program 38.3

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b2\right) + \sqrt{b2 \cdot b2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt 17.5

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

    if -4.4891519221511533e-128 < b2 < 4.983767219933664e+51

    1. Initial program 11.5

      \[\frac{\left(-b2\right) - \sqrt{b2 \cdot b2 - a \cdot c}}{a}\]

    if 4.983767219933664e+51 < b2

    1. Initial program 39.7

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

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

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

Runtime

Time bar (total: 25.7s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(3052192724 3812927732 3686175817 630908657 2373248591 511094450)'
(FPCore (a b2 c)
  :name "NMSE problem 3.2.1, negative"
  :pre (and (>= (* b2 b2) (* a c)) (!= a 0))
  (/ (- (- b2) (sqrt (- (* b2 b2) (* a c)))) a))