Average Error: 34.0 → 9.1
Time: 26.0s
Precision: 64
Internal Precision: 3136
$\frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
$\begin{array}{l} \mathbf{if}\;b \le -1.6542749383198656 \cdot 10^{+143}:\\ \;\;\;\;\frac{b}{a} \cdot 2\\ \mathbf{elif}\;b \le -7.231414510710038 \cdot 10^{-215}:\\ \;\;\;\;\frac{1}{\frac{a}{b - \sqrt{b \cdot b - c \cdot a}}}\\ \mathbf{elif}\;b \le 8.099564696201428 \cdot 10^{+148}:\\ \;\;\;\;\frac{c}{b + \sqrt{b \cdot b - c \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot \frac{c \cdot a}{b}}{a}\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 4 regimes
2. ## if b < -1.6542749383198656e+143

1. Initial program 57.0

$\frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
2. Initial simplification57.0

$\leadsto \frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
3. Taylor expanded around -inf 3.3

$\leadsto \color{blue}{2 \cdot \frac{b}{a}}$

## if -1.6542749383198656e+143 < b < -7.231414510710038e-215

1. Initial program 7.7

$\frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
2. Initial simplification7.7

$\leadsto \frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
3. Using strategy rm
4. Applied clear-num7.8

$\leadsto \color{blue}{\frac{1}{\frac{a}{b - \sqrt{b \cdot b - a \cdot c}}}}$

## if -7.231414510710038e-215 < b < 8.099564696201428e+148

1. Initial program 32.3

$\frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
2. Initial simplification32.3

$\leadsto \frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
3. Using strategy rm
4. Applied flip--32.5

$\leadsto \frac{\color{blue}{\frac{b \cdot b - \sqrt{b \cdot b - a \cdot c} \cdot \sqrt{b \cdot b - a \cdot c}}{b + \sqrt{b \cdot b - a \cdot c}}}}{a}$
5. Applied associate-/l/37.2

$\leadsto \color{blue}{\frac{b \cdot b - \sqrt{b \cdot b - a \cdot c} \cdot \sqrt{b \cdot b - a \cdot c}}{a \cdot \left(b + \sqrt{b \cdot b - a \cdot c}\right)}}$
6. Simplified20.8

$\leadsto \frac{\color{blue}{a \cdot c}}{a \cdot \left(b + \sqrt{b \cdot b - a \cdot c}\right)}$
7. Using strategy rm
8. Applied times-frac9.5

$\leadsto \color{blue}{\frac{a}{a} \cdot \frac{c}{b + \sqrt{b \cdot b - a \cdot c}}}$
9. Simplified9.5

$\leadsto \color{blue}{1} \cdot \frac{c}{b + \sqrt{b \cdot b - a \cdot c}}$

## if 8.099564696201428e+148 < b

1. Initial program 62.1

$\frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
2. Initial simplification62.1

$\leadsto \frac{b - \sqrt{b \cdot b - a \cdot c}}{a}$
3. Taylor expanded around inf 14.3

$\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{a \cdot c}{b}}}{a}$
3. Recombined 4 regimes into one program.
4. Final simplification9.1

$\leadsto \begin{array}{l} \mathbf{if}\;b \le -1.6542749383198656 \cdot 10^{+143}:\\ \;\;\;\;\frac{b}{a} \cdot 2\\ \mathbf{elif}\;b \le -7.231414510710038 \cdot 10^{-215}:\\ \;\;\;\;\frac{1}{\frac{a}{b - \sqrt{b \cdot b - c \cdot a}}}\\ \mathbf{elif}\;b \le 8.099564696201428 \cdot 10^{+148}:\\ \;\;\;\;\frac{c}{b + \sqrt{b \cdot b - c \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot \frac{c \cdot a}{b}}{a}\\ \end{array}$

# Runtime

Time bar (total: 26.0s)Debug log

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