Average Error: 33.4 → 7.0
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 -3.754894404003021 \cdot 10^{+84}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{b_2} - \left(\frac{b_2}{a} + \frac{b_2}{a}\right)\\ \mathbf{if}\;b_2 \le 6.932576810200133 \cdot 10^{-254}:\\ \;\;\;\;\left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{if}\;b_2 \le 6.19795767294399 \cdot 10^{+153}:\\ \;\;\;\;\left(\sqrt[3]{\frac{c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}} \cdot \sqrt[3]{\frac{c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\right) \cdot \sqrt[3]{\frac{c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot a}{\frac{b_2}{c}} - 2 \cdot b_2}\\ \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 < -3.754894404003021e+84

    1. Initial program 42.1

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

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

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

    if -3.754894404003021e+84 < b_2 < 6.932576810200133e-254

    1. Initial program 9.8

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv9.9

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

    if 6.932576810200133e-254 < b_2 < 6.19795767294399e+153

    1. Initial program 35.7

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

      \[\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 simplify15.6

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt16.3

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

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

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

    if 6.19795767294399e+153 < b_2

    1. Initial program 62.9

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

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

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

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

Runtime

Time bar (total: 1.2m)Debug logProfile

herbie shell --seed '#(1071501266 3581234924 1086666455 2685055582 1243441566 1802958749)' 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))