Average Error: 33.8 → 9.5
Time: 32.9s
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 -7.821259807821955 \cdot 10^{+97}:\\ \;\;\;\;(-2 \cdot \left(\frac{b_2}{a}\right) + \left(\frac{c}{\frac{b_2}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b_2 \le 1.8654307089523977 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt{{b_2}^{2} - c \cdot a} - b_2}{a}\\ \mathbf{elif}\;b_2 \le 1.3764583204452686 \cdot 10^{-69} \lor \neg \left(b_2 \le 3.35216509408091 \cdot 10^{+129}\right):\\ \;\;\;\;\frac{c}{b_2} \cdot \frac{-1}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - c \cdot a} + b_2} \cdot \left(\sqrt[3]{\frac{1}{a}} \cdot \left((\left(-a\right) \cdot c + 0)_* \cdot \sqrt[3]{\frac{1}{a}}\right)\right)\\ \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 < -7.821259807821955e+97

    1. Initial program 44.9

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

      \[\leadsto \frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\]
    3. Taylor expanded around -inf 44.9

      \[\leadsto \frac{\sqrt{\color{blue}{{b_2}^{2} - a \cdot c}} - b_2}{a}\]
    4. Taylor expanded around -inf 4.4

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

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

    if -7.821259807821955e+97 < b_2 < 1.8654307089523977e-124

    1. Initial program 11.5

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

      \[\leadsto \frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\]
    3. Taylor expanded around -inf 11.5

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

    if 1.8654307089523977e-124 < b_2 < 1.3764583204452686e-69 or 3.35216509408091e+129 < b_2

    1. Initial program 55.8

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

      \[\leadsto \frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\]
    3. Taylor expanded around -inf 55.8

      \[\leadsto \frac{\sqrt{\color{blue}{{b_2}^{2} - a \cdot c}} - b_2}{a}\]
    4. Taylor expanded around inf 7.0

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

    if 1.3764583204452686e-69 < b_2 < 3.35216509408091e+129

    1. Initial program 43.9

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

      \[\leadsto \frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\]
    3. Using strategy rm
    4. Applied clear-num43.9

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    5. Using strategy rm
    6. Applied div-inv43.9

      \[\leadsto \frac{1}{\color{blue}{a \cdot \frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    7. Applied associate-/r*43.9

      \[\leadsto \color{blue}{\frac{\frac{1}{a}}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    8. Using strategy rm
    9. Applied flip--44.0

      \[\leadsto \frac{\frac{1}{a}}{\frac{1}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}}}\]
    10. Applied associate-/r/44.0

      \[\leadsto \frac{\frac{1}{a}}{\color{blue}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2} \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2\right)}}\]
    11. Applied add-cube-cbrt44.1

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{\frac{1}{a}}\right) \cdot \sqrt[3]{\frac{1}{a}}}}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2} \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2\right)}\]
    12. Applied times-frac44.1

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{\frac{1}{a}}}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2}} \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}\]
    13. Simplified12.9

      \[\leadsto \color{blue}{\left(\left((\left(-a\right) \cdot c + 0)_* \cdot \sqrt[3]{\frac{1}{a}}\right) \cdot \sqrt[3]{\frac{1}{a}}\right)} \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification9.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -7.821259807821955 \cdot 10^{+97}:\\ \;\;\;\;(-2 \cdot \left(\frac{b_2}{a}\right) + \left(\frac{c}{\frac{b_2}{\frac{1}{2}}}\right))_*\\ \mathbf{elif}\;b_2 \le 1.8654307089523977 \cdot 10^{-124}:\\ \;\;\;\;\frac{\sqrt{{b_2}^{2} - c \cdot a} - b_2}{a}\\ \mathbf{elif}\;b_2 \le 1.3764583204452686 \cdot 10^{-69} \lor \neg \left(b_2 \le 3.35216509408091 \cdot 10^{+129}\right):\\ \;\;\;\;\frac{c}{b_2} \cdot \frac{-1}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - c \cdot a} + b_2} \cdot \left(\sqrt[3]{\frac{1}{a}} \cdot \left((\left(-a\right) \cdot c + 0)_* \cdot \sqrt[3]{\frac{1}{a}}\right)\right)\\ \end{array}\]

Runtime

Time bar (total: 32.9s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes31.99.55.526.384.7%
herbie shell --seed 2018353 +o rules:numerics
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))