Average Error: 33.7 → 10.6
Time: 1.9m
Precision: 64
Internal Precision: 3392
\[\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 -1.5438823640975016 \cdot 10^{+89}:\\ \;\;\;\;\frac{\left(\frac{3}{2} \cdot a\right) \cdot \frac{c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{if}\;b \le 5.4962934305345145 \cdot 10^{-130}:\\ \;\;\;\;\frac{1}{\frac{3 \cdot a}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-3}{2}}{3} \cdot \frac{c}{b}\\ \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 < -1.5438823640975016e+89

    1. Initial program 42.7

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied clear-num42.8

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

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

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

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

    if -1.5438823640975016e+89 < b < 5.4962934305345145e-130

    1. Initial program 11.8

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied clear-num11.9

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

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

    if 5.4962934305345145e-130 < b

    1. Initial program 50.2

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

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

      \[\leadsto \color{blue}{1 \cdot \left(\frac{c}{b} \cdot \frac{\frac{-3}{2}}{3}\right)}\]
  3. Recombined 3 regimes into one program.
  4. Applied simplify10.6

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b \le -1.5438823640975016 \cdot 10^{+89}:\\ \;\;\;\;\frac{\left(\frac{3}{2} \cdot a\right) \cdot \frac{c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{if}\;b \le 5.4962934305345145 \cdot 10^{-130}:\\ \;\;\;\;\frac{1}{\frac{3 \cdot a}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-3}{2}}{3} \cdot \frac{c}{b}\\ \end{array}}\]

Runtime

Time bar (total: 1.9m)Debug logProfile

herbie shell --seed '#(1071979731 1496239409 439705970 2863295848 982327776 189749553)' 
(FPCore (a b c d)
  :name "Cubic critical"
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))