Average Error: 33.2 → 10.4
Time: 32.0s
Precision: 64
Internal Precision: 128
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -2.2624163142142334 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -2.014594234406352 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{1}{a}}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2} \cdot \left(c \cdot a\right)\\ \mathbf{elif}\;b_2 \le -1.1320615158913861 \cdot 10^{-146}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 2.8358752990862995 \cdot 10^{+119}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{\left(-a\right) \cdot c + b_2 \cdot b_2}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot \frac{1}{2} - 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 < -2.2624163142142334e+27 or -2.014594234406352e-62 < b_2 < -1.1320615158913861e-146

    1. Initial program 51.7

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

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

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

    if -2.2624163142142334e+27 < b_2 < -2.014594234406352e-62

    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{b_2 \cdot b_2 - a \cdot c}}{a}\]
    3. Using strategy rm
    4. Applied sub-neg39.9

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{b_2 \cdot b_2 + \left(-a \cdot c\right)}}}{a}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity39.9

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 + \left(-a \cdot c\right)}}}}\]
    8. Using strategy rm
    9. Applied div-inv39.9

      \[\leadsto \frac{1}{\color{blue}{a \cdot \frac{1}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 + \left(-a \cdot c\right)}}}}\]
    10. Applied associate-/r*39.9

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

      \[\leadsto \frac{\frac{1}{a}}{\color{blue}{\frac{1}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    12. Using strategy rm
    13. Applied flip--40.0

      \[\leadsto \frac{\frac{1}{a}}{\frac{1}{\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}}}}}\]
    14. Applied associate-/r/40.0

      \[\leadsto \frac{\frac{1}{a}}{\color{blue}{\frac{1}{\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}} \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}\]
    15. Applied div-inv40.0

      \[\leadsto \frac{\color{blue}{1 \cdot \frac{1}{a}}}{\frac{1}{\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}} \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}\]
    16. Applied times-frac42.9

      \[\leadsto \color{blue}{\frac{1}{\frac{1}{\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}}} \cdot \frac{\frac{1}{a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}\]
    17. Simplified17.8

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

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

    if -1.1320615158913861e-146 < b_2 < 2.8358752990862995e+119

    1. Initial program 11.3

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

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    3. Using strategy rm
    4. Applied sub-neg11.3

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

    if 2.8358752990862995e+119 < b_2

    1. Initial program 49.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -2.2624163142142334 \cdot 10^{+27}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -2.014594234406352 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{1}{a}}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2} \cdot \left(c \cdot a\right)\\ \mathbf{elif}\;b_2 \le -1.1320615158913861 \cdot 10^{-146}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 2.8358752990862995 \cdot 10^{+119}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{\left(-a\right) \cdot c + b_2 \cdot b_2}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot \frac{1}{2} - 2 \cdot \frac{b_2}{a}\\ \end{array}\]

Runtime

Time bar (total: 32.0s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes33.210.45.727.583%
herbie shell --seed 2018352 
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))