Average Error: 52.7 → 50.7
Time: 23.6s
Precision: 64
Internal Precision: 2112
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\left(-b\right) + \sqrt{\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}} \cdot \sqrt{\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}}}{3 \cdot a} \le -2.5596031988135586 \cdot 10^{-33}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}} \cdot \sqrt{\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\left(b + b\right)}{a \cdot 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 2 regimes
  2. if (/ (+ (- b) (* (sqrt (sqrt (- (* b b) (* a (* 3 c))))) (sqrt (sqrt (- (* b b) (* a (* 3 c))))))) (* 3 a)) < -2.5596031988135586e-33

    1. Initial program 40.9

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied add-log-exp58.0

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

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

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

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

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

    if -2.5596031988135586e-33 < (/ (+ (- b) (* (sqrt (sqrt (- (* b b) (* a (* 3 c))))) (sqrt (sqrt (- (* b b) (* a (* 3 c))))))) (* 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. Using strategy rm
    3. Applied add-log-exp62.2

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

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

      \[\leadsto \color{blue}{\frac{-\left(b + b\right)}{a \cdot 3}}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 23.6s)Debug logProfile

herbie shell --seed '#(1072107073 2127697367 3936270018 2300570620 2134894798 4023771849)' 
(FPCore (a b c d)
  :name "Cubic critical, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))