Average Error: 33.9 → 8.2
Time: 1.5m
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 -12994633806777052.0:\\ \;\;\;\;\frac{\frac{-1}{2} \cdot c}{b_2}\\ \mathbf{if}\;b_2 \le -2.0503675161606082 \cdot 10^{-282}:\\ \;\;\;\;\frac{c \cdot \frac{a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}{a}\\ \mathbf{if}\;b_2 \le 3.715525201511079 \cdot 10^{+82}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{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 < -12994633806777052.0

    1. Initial program 56.1

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

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

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

    if -12994633806777052.0 < b_2 < -2.0503675161606082e-282

    1. Initial program 27.5

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

      \[\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 simplify17.1

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

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}}{a}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity17.1

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

      \[\leadsto \frac{\color{blue}{\frac{c}{1} \cdot \frac{a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}}{a}\]
    9. Applied simplify14.1

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

    if -2.0503675161606082e-282 < b_2 < 3.715525201511079e+82

    1. Initial program 10.1

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

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

    if 3.715525201511079e+82 < b_2

    1. Initial program 41.4

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

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

Runtime

Time bar (total: 1.5m)Debug logProfile

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