Average Error: 33.4 → 10.3
Time: 1.1m
Precision: 64
Internal Precision: 3200
\[\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 -9.929910345568095 \cdot 10^{+126}:\\ \;\;\;\;\frac{\frac{c}{\frac{b}{\frac{3}{2}}} - \frac{b + b}{a}}{3}\\ \mathbf{if}\;b \le 1.5775731528019195 \cdot 10^{-63}:\\ \;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot \frac{\frac{-3}{2}}{3}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Split input into 3 regimes
  2. if b < -9.929910345568095e+126

    1. Initial program 52.1

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity52.1

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a}\]
    4. Applied times-frac52.1

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

      \[\leadsto \frac{1}{3} \cdot \frac{\color{blue}{\frac{3}{2} \cdot \frac{c \cdot a}{b} - 2 \cdot b}}{a}\]
    6. Applied simplify3.2

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

    if -9.929910345568095e+126 < b < 1.5775731528019195e-63

    1. Initial program 13.2

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied associate-/r*13.2

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

    if 1.5775731528019195e-63 < b

    1. Initial program 52.7

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Taylor expanded around inf 19.5

      \[\leadsto \frac{\color{blue}{\frac{-3}{2} \cdot \frac{c \cdot a}{b}}}{3 \cdot a}\]
    3. Applied simplify9.0

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

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed '#(1070100504 930361288 1279167582 284574201 1450237281 2578255382)' 
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))