Average Error: 33.3 → 11.9
Time: 26.6s
Precision: 64
Internal Precision: 3392
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -3.4580500412981637 \cdot 10^{+124}:\\ \;\;\;\;\frac{\frac{-1}{2} \cdot \frac{a \cdot c}{b_2}}{a}\\ \mathbf{elif}\;b_2 \le -9.164732542528427 \cdot 10^{-135}:\\ \;\;\;\;\frac{a \cdot c}{a \cdot \left(\sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*} + \left(-b_2\right)\right)}\\ \mathbf{elif}\;b_2 \le 7.244591904232477 \cdot 10^{+152}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - 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.4580500412981637e+124

    1. Initial program 59.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification59.9

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}{a}\]
    3. Taylor expanded around -inf 13.9

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{a \cdot c}{b_2}}}{a}\]

    if -3.4580500412981637e+124 < b_2 < -9.164732542528427e-135

    1. Initial program 39.9

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification39.9

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}{a}\]
    3. Using strategy rm
    4. Applied flip--40.0

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*} \cdot \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}{\left(-b_2\right) + \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}}}{a}\]
    5. Applied associate-/l/42.7

      \[\leadsto \color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*} \cdot \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}{a \cdot \left(\left(-b_2\right) + \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}\right)}}\]
    6. Simplified18.4

      \[\leadsto \frac{\color{blue}{a \cdot c}}{a \cdot \left(\left(-b_2\right) + \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}\right)}\]

    if -9.164732542528427e-135 < b_2 < 7.244591904232477e+152

    1. Initial program 10.3

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification10.3

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}{a}\]
    3. Using strategy rm
    4. Applied clear-num10.5

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}}}\]

    if 7.244591904232477e+152 < b_2

    1. Initial program 60.3

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification60.2

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}{a}\]
    3. Taylor expanded around 0 2.4

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{b_2}}{a}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification11.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -3.4580500412981637 \cdot 10^{+124}:\\ \;\;\;\;\frac{\frac{-1}{2} \cdot \frac{a \cdot c}{b_2}}{a}\\ \mathbf{elif}\;b_2 \le -9.164732542528427 \cdot 10^{-135}:\\ \;\;\;\;\frac{a \cdot c}{a \cdot \left(\sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*} + \left(-b_2\right)\right)}\\ \mathbf{elif}\;b_2 \le 7.244591904232477 \cdot 10^{+152}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{(\left(-a\right) \cdot c + \left(b_2 \cdot b_2\right))_*}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - b_2}{a}\\ \end{array}\]

Runtime

Time bar (total: 26.6s)Debug logProfile

herbie shell --seed 2018221 +o rules:numerics
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))