Average Error: 33.5 → 8.2
Time: 1.2m
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 -0.606038404889186:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot c}{\frac{b_2}{a}} - \left(b_2 + b_2\right)}\\ \mathbf{if}\;b_2 \le -1.4885774312093938 \cdot 10^{-217}:\\ \;\;\;\;\frac{\frac{c}{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}} \cdot \frac{a}{\sqrt[3]{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\\ \mathbf{if}\;b_2 \le 2.544983965740742 \cdot 10^{+119}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{a}{b_2} \cdot \left(\frac{1}{2} \cdot c\right) - \left(b_2 + b_2\right)}{a}\\ \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 < -0.606038404889186

    1. Initial program 55.2

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

      \[\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 simplify25.9

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

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

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

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

    if -0.606038404889186 < b_2 < -1.4885774312093938e-217

    1. Initial program 29.3

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--29.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 simplify18.6

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

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt19.3

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

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

    if -1.4885774312093938e-217 < b_2 < 2.544983965740742e+119

    1. Initial program 9.6

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

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

    if 2.544983965740742e+119 < b_2

    1. Initial program 48.7

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Taylor expanded around inf 10.6

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

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

Runtime

Time bar (total: 1.2m)Debug logProfile

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