Average Error: 32.9 → 10.0
Time: 1.4m
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 -1.8905229956434865 \cdot 10^{+98}:\\ \;\;\;\;\frac{c}{\frac{a}{b_2} \cdot \left(\frac{1}{2} \cdot c\right) - 2 \cdot b_2}\\ \mathbf{if}\;b_2 \le -2.101916032066834 \cdot 10^{-22}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\\ \mathbf{if}\;b_2 \le -6.141293241181732 \cdot 10^{-109}:\\ \;\;\;\;\frac{c}{\frac{a}{b_2} \cdot \left(\frac{1}{2} \cdot c\right) - 2 \cdot b_2}\\ \mathbf{if}\;b_2 \le 6.959770719239994 \cdot 10^{+151}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{\frac{1}{2}}{b_2} - \frac{b_2}{\frac{a}{2}}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if b_2 < -1.8905229956434865e+98 or -2.101916032066834e-22 < b_2 < -6.141293241181732e-109

    1. Initial program 52.8

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a}\]
    4. Applied simplify27.8

      \[\leadsto \frac{\frac{\color{blue}{a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Applied simplify27.8

      \[\leadsto \frac{\frac{a \cdot c}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Taylor expanded around -inf 20.6

      \[\leadsto \frac{\frac{a \cdot c}{\color{blue}{\frac{1}{2} \cdot \frac{a \cdot c}{b_2} - 2 \cdot b_2}}}{a}\]
    7. Applied simplify9.0

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

    if -1.8905229956434865e+98 < b_2 < -2.101916032066834e-22

    1. Initial program 44.5

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a}\]
    4. Applied simplify14.0

      \[\leadsto \frac{\frac{\color{blue}{a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Applied simplify14.0

      \[\leadsto \frac{\frac{a \cdot c}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Using strategy rm
    7. Applied add-sqr-sqrt14.2

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

    if -6.141293241181732e-109 < b_2 < 6.959770719239994e+151

    1. Initial program 11.2

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

    if 6.959770719239994e+151 < b_2

    1. Initial program 59.6

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied clear-num59.6

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    4. Taylor expanded around inf 10.8

      \[\leadsto \frac{1}{\frac{a}{\color{blue}{\frac{1}{2} \cdot \frac{a \cdot c}{b_2} - 2 \cdot b_2}}}\]
    5. Applied simplify2.3

      \[\leadsto \color{blue}{c \cdot \frac{\frac{1}{2}}{b_2} - \frac{b_2}{\frac{a}{2}}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed 2018296 
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))