Average Error: 33.0 → 9.3
Time: 43.2s
Precision: 64
Internal Precision: 3200
\[\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -9.999181042788858 \cdot 10^{+88}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b/2} - 2 \cdot \frac{b/2}{a}\\ \mathbf{if}\;b/2 \le 1.1635978246771746 \cdot 10^{-57}:\\ \;\;\;\;\left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{(\frac{1}{2} \cdot \left(\frac{a}{\frac{b/2}{c}}\right) + \left(\left(-b/2\right) - b/2\right))_*}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b/2

Bits error versus c

Derivation

  1. Split input into 3 regimes
  2. if b/2 < -9.999181042788858e+88

    1. Initial program 42.2

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

      \[\leadsto \color{blue}{\left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right) \cdot \frac{1}{a}}\]
    4. Taylor expanded around -inf 4.2

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{c}{b/2} - 2 \cdot \frac{b/2}{a}}\]

    if -9.999181042788858e+88 < b/2 < 1.1635978246771746e-57

    1. Initial program 12.3

      \[\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv12.4

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

    if 1.1635978246771746e-57 < b/2

    1. Initial program 53.8

      \[\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv53.8

      \[\leadsto \color{blue}{\left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right) \cdot \frac{1}{a}}\]
    4. Using strategy rm
    5. Applied flip-+53.9

      \[\leadsto \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}}} \cdot \frac{1}{a}\]
    6. Applied associate-*l/53.9

      \[\leadsto \color{blue}{\frac{\left(\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}\right) \cdot \frac{1}{a}}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}\]
    7. Applied simplify23.2

      \[\leadsto \frac{\color{blue}{\frac{c \cdot a}{a}}}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}\]
    8. Taylor expanded around inf 13.9

      \[\leadsto \frac{\frac{c \cdot a}{a}}{\left(-b/2\right) - \color{blue}{\left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}}\]
    9. Applied simplify7.7

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

Runtime

Time bar (total: 43.2s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' +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))