Average Error: 21.1 → 0.2
Time: 12.1s
Precision: 64
Internal Precision: 576
\[\sqrt{\left(8 \cdot a + b \cdot b\right) - 4 \cdot c}\]
\[\begin{array}{l} \mathbf{if}\;b \le -1.2956179921120513 \cdot 10^{+154}:\\ \;\;\;\;\frac{c}{b} \cdot 2 - \left(b + 4 \cdot \frac{a}{b}\right)\\ \mathbf{elif}\;b \le 7.759169268738001 \cdot 10^{+121}:\\ \;\;\;\;\sqrt{8 \cdot a + \left(b \cdot b - c \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(b + 4 \cdot \frac{a}{b}\right) - \frac{c}{b} \cdot 2\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if b < -1.2956179921120513e+154

    1. Initial program 59.6

      \[\sqrt{\left(8 \cdot a + b \cdot b\right) - 4 \cdot c}\]
    2. Initial simplification59.6

      \[\leadsto \sqrt{\left(b \cdot b - 4 \cdot c\right) + 8 \cdot a}\]
    3. Taylor expanded around -inf 0.0

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

    if -1.2956179921120513e+154 < b < 7.759169268738001e+121

    1. Initial program 0.2

      \[\sqrt{\left(8 \cdot a + b \cdot b\right) - 4 \cdot c}\]
    2. Initial simplification0.2

      \[\leadsto \sqrt{\left(b \cdot b - 4 \cdot c\right) + 8 \cdot a}\]

    if 7.759169268738001e+121 < b

    1. Initial program 50.2

      \[\sqrt{\left(8 \cdot a + b \cdot b\right) - 4 \cdot c}\]
    2. Initial simplification50.2

      \[\leadsto \sqrt{\left(b \cdot b - 4 \cdot c\right) + 8 \cdot a}\]
    3. Taylor expanded around inf 0.3

      \[\leadsto \color{blue}{\left(4 \cdot \frac{a}{b} + b\right) - 2 \cdot \frac{c}{b}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -1.2956179921120513 \cdot 10^{+154}:\\ \;\;\;\;\frac{c}{b} \cdot 2 - \left(b + 4 \cdot \frac{a}{b}\right)\\ \mathbf{elif}\;b \le 7.759169268738001 \cdot 10^{+121}:\\ \;\;\;\;\sqrt{8 \cdot a + \left(b \cdot b - c \cdot 4\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(b + 4 \cdot \frac{a}{b}\right) - \frac{c}{b} \cdot 2\\ \end{array}\]

Runtime

Time bar (total: 12.1s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (a b c)
  :name "sqrt(8*a+b*b-4*c)"
  (sqrt (- (+ (* 8 a) (* b b)) (* 4 c))))