Average Error: 33.7 → 6.1
Time: 19.6s
Precision: 64
Internal precision: 2688
\[\frac{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -1.2104515124530692 \cdot 10^{+151}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b/2} - 2 \cdot \frac{b/2}{a}\\ \mathbf{if}\;b/2 \le 2.5179726424422933 \cdot 10^{-277}:\\ \;\;\;\;\left(\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{if}\;b/2 \le 2.3106113327966147 \cdot 10^{+121}:\\ \;\;\;\;\frac{1}{\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - c \cdot a}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot c}{\frac{b/2}{a}} + \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 4 regimes.
  2. if b/2 < -1.2104515124530692e+151

    1. Initial program 59.2

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b/2\right) \cdot \left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c} \cdot \sqrt{{b/2}^2 - a \cdot c}}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}}{a}\]
    4. Applied simplify 62.5

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied clear-num 62.5

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

      \[\leadsto \frac{1}{\color{blue}{\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - c \cdot a}}{c}}}\]
    8. Applied taylor 0.0

      \[\leadsto \frac{1}{2} \cdot \frac{c}{b/2} - 2 \cdot \frac{b/2}{a}\]
    9. Taylor expanded around -inf 0.0

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

    if -1.2104515124530692e+151 < b/2 < 2.5179726424422933e-277

    1. Initial program 9.0

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

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

    if 2.5179726424422933e-277 < b/2 < 2.3106113327966147e+121

    1. Initial program 33.9

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b/2\right) \cdot \left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c} \cdot \sqrt{{b/2}^2 - a \cdot c}}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}}{a}\]
    4. Applied simplify 16.0

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied clear-num 16.2

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

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

    if 2.3106113327966147e+121 < b/2

    1. Initial program 60.2

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b/2\right) \cdot \left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c} \cdot \sqrt{{b/2}^2 - a \cdot c}}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}}{a}\]
    4. Applied simplify 35.7

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied clear-num 35.9

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

      \[\leadsto \frac{1}{\color{blue}{\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - c \cdot a}}{c}}}\]
    8. Applied taylor 9.1

      \[\leadsto \frac{1}{\frac{\left(-b/2\right) - \left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}{c}}\]
    9. Taylor expanded around inf 9.1

      \[\leadsto \frac{1}{\frac{\left(-b/2\right) - \color{blue}{\left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}}{c}}\]
    10. Applied simplify 1.1

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

Runtime

Time bar (total: 19.6s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1067901057 3396600083 3715501224 3126139233 3908045574 1593683916)'
(FPCore (a b/2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))