Average Error: 29.2 → 17.5
Time: 9.4s
Precision: binary64
\[1.05367121277235087 \cdot 10^{-8} \lt a \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt b \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt c \lt 94906265.6242515594\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;b \le 7491.95990052576326 \lor \neg \left(b \le 37187.792086002606\right) \land b \le 107697.61652900142:\\ \;\;\;\;\frac{\frac{\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) - {b}^{2}}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + b}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1.5}{b \cdot \frac{3 \cdot a}{a \cdot c}}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Split input into 2 regimes
  2. if b < 7491.95990052576326 or 37187.792086002606 < b < 107697.61652900142

    1. Initial program 21.1

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Simplified21.1

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}}\]
    3. Using strategy rm
    4. Applied flip--21.1

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b \cdot b}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + b}}}{3 \cdot a}\]
    5. Simplified20.1

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

    if 7491.95990052576326 < b < 37187.792086002606 or 107697.61652900142 < b

    1. Initial program 39.0

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Simplified39.0

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a}\]
    4. Using strategy rm
    5. Applied associate-*r/14.4

      \[\leadsto \frac{\color{blue}{\frac{-1.5 \cdot \left(a \cdot c\right)}{b}}}{3 \cdot a}\]
    6. Applied associate-/l/14.4

      \[\leadsto \color{blue}{\frac{-1.5 \cdot \left(a \cdot c\right)}{\left(3 \cdot a\right) \cdot b}}\]
    7. Using strategy rm
    8. Applied associate-/l*14.4

      \[\leadsto \color{blue}{\frac{-1.5}{\frac{\left(3 \cdot a\right) \cdot b}{a \cdot c}}}\]
    9. Simplified14.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le 7491.95990052576326 \lor \neg \left(b \le 37187.792086002606\right) \land b \le 107697.61652900142:\\ \;\;\;\;\frac{\frac{\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) - {b}^{2}}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + b}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1.5}{b \cdot \frac{3 \cdot a}{a \cdot c}}\\ \end{array}\]

Reproduce

herbie shell --seed 2020182 
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (neg b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))