Average Error: 33.7 → 6.2
Time: 36.8s
Precision: 64
Internal Precision: 3456
\[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -9.355156905614978 \cdot 10^{+153}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot a}{\frac{b/2}{c}} - \left(b/2 - \left(-b/2\right)\right)}\\ \mathbf{if}\;b/2 \le 1.9173617889725583 \cdot 10^{-255}:\\ \;\;\;\;\frac{\frac{c}{1}}{\sqrt{b/2 \cdot b/2 - a \cdot c} + \left(-b/2\right)}\\ \mathbf{if}\;b/2 \le 8.064324250100004 \cdot 10^{+121}:\\ \;\;\;\;\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b/2}{a}\\ \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 < -9.355156905614978e+153

    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.8

      \[\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 *-un-lft-identity37.8

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{1 \cdot \left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right)}}}{a}\]
    7. Applied times-frac37.8

      \[\leadsto \frac{\color{blue}{\frac{c}{1} \cdot \frac{a}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}}{a}\]
    8. Applied associate-/l*37.8

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

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

      \[\leadsto \frac{\frac{c}{1}}{\color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)} + \left(-b/2\right)}\]
    11. Applied simplify1.0

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

    if -9.355156905614978e+153 < b/2 < 1.9173617889725583e-255

    1. Initial program 32.9

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

      \[\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.3

      \[\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 *-un-lft-identity15.3

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{1 \cdot \left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right)}}}{a}\]
    7. Applied times-frac14.8

      \[\leadsto \frac{\color{blue}{\frac{c}{1} \cdot \frac{a}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}}{a}\]
    8. Applied associate-/l*11.2

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

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

    if 1.9173617889725583e-255 < b/2 < 8.064324250100004e+121

    1. Initial program 7.8

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]

    if 8.064324250100004e+121 < b/2

    1. Initial program 50.8

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Taylor expanded around inf 3.0

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

Runtime

Time bar (total: 36.8s)Debug logProfile

herbie shell --seed '#(1070131407 1246090267 3027482374 2150728003 2026520792 2347815650)' 
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))