Average Error: 43.8 → 42.2
Time: 35.4s
Precision: 64
Internal Precision: 2368
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{\sqrt{\left(b \cdot b - a \cdot \left(c \cdot 3\right)\right) \cdot \left(a \cdot \left(c \cdot 3\right) + b \cdot b\right)}}{\sqrt{a \cdot \left(c \cdot 3\right) + b \cdot b}} - b}{3 \cdot a} \le -1.850810227248647 \cdot 10^{-21}:\\ \;\;\;\;\frac{\frac{\sqrt{\left(b \cdot b - a \cdot \left(c \cdot 3\right)\right) \cdot \left(a \cdot \left(c \cdot 3\right) + b \cdot b\right)}}{\sqrt{a \cdot \left(c \cdot 3\right) + b \cdot b}} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{3 \cdot a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Split input into 2 regimes
  2. if (/ (- (/ (sqrt (* (- (* b b) (* (* c 3) a)) (+ (* b b) (* (* c 3) a)))) (sqrt (+ (* (* c 3) a) (* b b)))) b) (* 3 a)) < -1.850810227248647e-21

    1. Initial program 26.0

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

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

      \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{\log \left(e^{\left(a \cdot c\right) \cdot 3}\right)}} - b}{3 \cdot a}\]
    5. Using strategy rm
    6. Applied flip--48.6

      \[\leadsto \frac{\sqrt{\color{blue}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \log \left(e^{\left(a \cdot c\right) \cdot 3}\right) \cdot \log \left(e^{\left(a \cdot c\right) \cdot 3}\right)}{b \cdot b + \log \left(e^{\left(a \cdot c\right) \cdot 3}\right)}}} - b}{3 \cdot a}\]
    7. Applied sqrt-div48.4

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \log \left(e^{\left(a \cdot c\right) \cdot 3}\right) \cdot \log \left(e^{\left(a \cdot c\right) \cdot 3}\right)}}{\sqrt{b \cdot b + \log \left(e^{\left(a \cdot c\right) \cdot 3}\right)}}} - b}{3 \cdot a}\]
    8. Applied simplify45.2

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

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

    if -1.850810227248647e-21 < (/ (- (/ (sqrt (* (- (* b b) (* (* c 3) a)) (+ (* b b) (* (* c 3) a)))) (sqrt (+ (* (* c 3) a) (* b b)))) b) (* 3 a))

    1. Initial program 61.8

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot b} - b}{3 \cdot a}\]
  3. Recombined 2 regimes into one program.
  4. Applied simplify42.2

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

Runtime

Time bar (total: 35.4s)Debug logProfile

herbie shell --seed '#(1071852389 864846987 1238109217 3425890003 4124793586 650694553)' 
(FPCore (a b c d)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))