Average Error: 33.8 → 16.9
Time: 27.6s
Precision: 64
Internal Precision: 3392
$\frac{\left(-x\right) - \sqrt{x \cdot x - \left(4 \cdot y\right) \cdot z}}{2 \cdot z}$
$\begin{array}{l} \mathbf{if}\;x \le -4.178732388010056 \cdot 10^{-128}:\\ \;\;\;\;\frac{4 \cdot \left(z \cdot y\right)}{\left(z \cdot 2\right) \cdot \left(\sqrt{x \cdot x - z \cdot \left(y \cdot 4\right)} + \left(-x\right)\right)}\\ \mathbf{elif}\;x \le 2.7512793042658205 \cdot 10^{+92}:\\ \;\;\;\;\frac{-x}{z \cdot 2} - \frac{\sqrt{x \cdot x - z \cdot \left(y \cdot 4\right)}}{z \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{z}\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 3 regimes
2. ## if x < -4.178732388010056e-128

1. Initial program 50.8

$\frac{\left(-x\right) - \sqrt{x \cdot x - \left(4 \cdot y\right) \cdot z}}{2 \cdot z}$
2. Initial simplification50.8

$\leadsto \frac{\left(-x\right) - \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}}{2 \cdot z}$
3. Using strategy rm
4. Applied flip--50.8

$\leadsto \frac{\color{blue}{\frac{\left(-x\right) \cdot \left(-x\right) - \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)} \cdot \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}}{\left(-x\right) + \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}}}}{2 \cdot z}$
5. Applied associate-/l/52.1

$\leadsto \color{blue}{\frac{\left(-x\right) \cdot \left(-x\right) - \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)} \cdot \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}}{\left(2 \cdot z\right) \cdot \left(\left(-x\right) + \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}\right)}}$
6. Simplified26.3

$\leadsto \frac{\color{blue}{\left(z \cdot y\right) \cdot 4}}{\left(2 \cdot z\right) \cdot \left(\left(-x\right) + \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}\right)}$

## if -4.178732388010056e-128 < x < 2.7512793042658205e+92

1. Initial program 11.9

$\frac{\left(-x\right) - \sqrt{x \cdot x - \left(4 \cdot y\right) \cdot z}}{2 \cdot z}$
2. Initial simplification11.9

$\leadsto \frac{\left(-x\right) - \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}}{2 \cdot z}$
3. Using strategy rm
4. Applied div-sub11.9

$\leadsto \color{blue}{\frac{-x}{2 \cdot z} - \frac{\sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}}{2 \cdot z}}$

## if 2.7512793042658205e+92 < x

1. Initial program 42.6

$\frac{\left(-x\right) - \sqrt{x \cdot x - \left(4 \cdot y\right) \cdot z}}{2 \cdot z}$
2. Initial simplification42.6

$\leadsto \frac{\left(-x\right) - \sqrt{x \cdot x - z \cdot \left(4 \cdot y\right)}}{2 \cdot z}$
3. Taylor expanded around inf 4.2

$\leadsto \color{blue}{-1 \cdot \frac{x}{z}}$
4. Simplified4.2

$\leadsto \color{blue}{-\frac{x}{z}}$
3. Recombined 3 regimes into one program.
4. Final simplification16.9

$\leadsto \begin{array}{l} \mathbf{if}\;x \le -4.178732388010056 \cdot 10^{-128}:\\ \;\;\;\;\frac{4 \cdot \left(z \cdot y\right)}{\left(z \cdot 2\right) \cdot \left(\sqrt{x \cdot x - z \cdot \left(y \cdot 4\right)} + \left(-x\right)\right)}\\ \mathbf{elif}\;x \le 2.7512793042658205 \cdot 10^{+92}:\\ \;\;\;\;\frac{-x}{z \cdot 2} - \frac{\sqrt{x \cdot x - z \cdot \left(y \cdot 4\right)}}{z \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{z}\\ \end{array}$

# Runtime

Time bar (total: 27.6s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (x y z)
:name "(-x-sqrt(x*x-4*y*z))/(2z)"
(/ (- (- x) (sqrt (- (* x x) (* (* 4 y) z)))) (* 2 z)))