Average Error: 34.6 → 5.9
Time: 14.5s
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 -3.4957056054812805 \cdot 10^{+36}:\\ \;\;\;\;\frac{c}{\left(\frac{1}{2} \cdot a\right) \cdot \frac{c}{b/2} - \left(b/2 - \left(-b/2\right)\right)}\\ \mathbf{if}\;b/2 \le -3.3390283997923444 \cdot 10^{-254}:\\ \;\;\;\;{\left(\sqrt[3]{\frac{c}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}\right)}^3\\ \mathbf{if}\;b/2 \le 1.4004343880412904 \cdot 10^{+131}:\\ \;\;\;\;\left(\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}\right) \cdot \frac{1}{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 < -3.4957056054812805e+36

    1. Initial program 58.4

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

      \[\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.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 add-cube-cbrt 32.1

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

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

      \[\leadsto {\left(\sqrt[3]{\frac{c}{\left(-b/2\right) + \left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)}}\right)}^3\]
    9. Taylor expanded around -inf 8.3

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

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

    if -3.4957056054812805e+36 < b/2 < -3.3390283997923444e-254

    1. Initial program 29.9

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

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

      \[\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 add-cube-cbrt 17.3

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

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

    if -3.3390283997923444e-254 < b/2 < 1.4004343880412904e+131

    1. Initial program 9.1

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

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

    if 1.4004343880412904e+131 < b/2

    1. Initial program 53.8

      \[\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: 14.5s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1066785882 2324371342 4059510649 1466361199 2701357084 1216585281)'
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))