Average Error: 29.5 → 3.4
Time: 17.5s
Precision: 64
Internal Precision: 2368
\[\left(-b\right) + \sqrt{\left(-b\right) \cdot \left(-b\right) - c}\]
\[\begin{array}{l} \mathbf{if}\;b \le -1.3407175129675078 \cdot 10^{+154}:\\ \;\;\;\;\left(-b\right) - b\\ \mathbf{elif}\;b \le 4.252262307666019 \cdot 10^{-29}:\\ \;\;\;\;\sqrt{b \cdot b - c} - b\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot \frac{-1}{2}\\ \end{array}\]

Error

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.3407175129675078e+154

    1. Initial program 59.6

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

      \[\leadsto \sqrt{b \cdot b - c} - b\]
    3. Using strategy rm
    4. Applied add-cube-cbrt59.6

      \[\leadsto \sqrt{\color{blue}{\left(\sqrt[3]{b \cdot b - c} \cdot \sqrt[3]{b \cdot b - c}\right) \cdot \sqrt[3]{b \cdot b - c}}} - b\]
    5. Taylor expanded around -inf 0.0

      \[\leadsto \color{blue}{-1 \cdot b} - b\]
    6. Simplified0.0

      \[\leadsto \color{blue}{\left(-b\right)} - b\]

    if -1.3407175129675078e+154 < b < 4.252262307666019e-29

    1. Initial program 3.1

      \[\left(-b\right) + \sqrt{\left(-b\right) \cdot \left(-b\right) - c}\]
    2. Initial simplification3.1

      \[\leadsto \sqrt{b \cdot b - c} - b\]

    if 4.252262307666019e-29 < b

    1. Initial program 52.2

      \[\left(-b\right) + \sqrt{\left(-b\right) \cdot \left(-b\right) - c}\]
    2. Initial simplification52.2

      \[\leadsto \sqrt{b \cdot b - c} - b\]
    3. Taylor expanded around inf 5.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -1.3407175129675078 \cdot 10^{+154}:\\ \;\;\;\;\left(-b\right) - b\\ \mathbf{elif}\;b \le 4.252262307666019 \cdot 10^{-29}:\\ \;\;\;\;\sqrt{b \cdot b - c} - b\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot \frac{-1}{2}\\ \end{array}\]

Runtime

Time bar (total: 17.5s)Debug log

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