Average Error: 25.2 → 7.7
Time: 15.5s
Precision: 64
Internal Precision: 576
\[\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\]
\[\begin{array}{l} \mathbf{if}\;b \le -6.826205091476792 \cdot 10^{+149}:\\ \;\;\;\;\frac{a \cdot c}{b} \cdot 2 - b\\ \mathbf{elif}\;b \le 1.8905452877783028 \cdot 10^{+140}:\\ \;\;\;\;\sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}\\ \mathbf{else}:\\ \;\;\;\;b - \frac{a \cdot c}{b} \cdot 2\\ \end{array}\]

Error

Bits error versus b

Bits error versus a

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 < -6.826205091476792e+149

    1. Initial program 57.9

      \[\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\]
    2. Initial simplification57.9

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

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

    if -6.826205091476792e+149 < b < 1.8905452877783028e+140

    1. Initial program 8.4

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

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

    if 1.8905452877783028e+140 < b

    1. Initial program 55.8

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -6.826205091476792 \cdot 10^{+149}:\\ \;\;\;\;\frac{a \cdot c}{b} \cdot 2 - b\\ \mathbf{elif}\;b \le 1.8905452877783028 \cdot 10^{+140}:\\ \;\;\;\;\sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}\\ \mathbf{else}:\\ \;\;\;\;b - \frac{a \cdot c}{b} \cdot 2\\ \end{array}\]

Runtime

Time bar (total: 15.5s)Debug log

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