Average Error: 28.3 → 9.0
Time: 2.1m
Precision: 64
\[1.0536712127723509 \cdot 10^{-08} \lt a \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt b \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt c \lt 94906265.62425156\]
\[\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 10.437713474112526:\\ \;\;\;\;\frac{\left(\left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} - \left(\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot b}{\left(\left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) + \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) + \left(\left(b \cdot b\right) \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot b\right)\right)\right) \cdot \left(\left(3 \cdot a\right) \cdot \left(\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} + \left(b \cdot b + \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot b\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot \left(\frac{-3}{2} \cdot b + \frac{\frac{9}{8}}{\frac{\frac{b}{c}}{a}}\right)}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot b + \left(b \cdot b + \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right)}\\ \end{array}\]
\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 10.437713474112526:\\
\;\;\;\;\frac{\left(\left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} - \left(\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot b}{\left(\left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) + \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) + \left(\left(b \cdot b\right) \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot b\right)\right)\right) \cdot \left(\left(3 \cdot a\right) \cdot \left(\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} + \left(b \cdot b + \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot b\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{c \cdot \left(\frac{-3}{2} \cdot b + \frac{\frac{9}{8}}{\frac{\frac{b}{c}}{a}}\right)}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot b + \left(b \cdot b + \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right)}\\

\end{array}
double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r16173414 = b;
        double r16173415 = -r16173414;
        double r16173416 = r16173414 * r16173414;
        double r16173417 = 3.0;
        double r16173418 = a;
        double r16173419 = r16173417 * r16173418;
        double r16173420 = c;
        double r16173421 = r16173419 * r16173420;
        double r16173422 = r16173416 - r16173421;
        double r16173423 = sqrt(r16173422);
        double r16173424 = r16173415 + r16173423;
        double r16173425 = r16173424 / r16173419;
        return r16173425;
}

double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r16173426 = b;
        double r16173427 = 10.437713474112526;
        bool r16173428 = r16173426 <= r16173427;
        double r16173429 = r16173426 * r16173426;
        double r16173430 = c;
        double r16173431 = 3.0;
        double r16173432 = a;
        double r16173433 = r16173431 * r16173432;
        double r16173434 = r16173430 * r16173433;
        double r16173435 = r16173429 - r16173434;
        double r16173436 = r16173435 * r16173435;
        double r16173437 = r16173436 * r16173436;
        double r16173438 = sqrt(r16173435);
        double r16173439 = r16173437 * r16173438;
        double r16173440 = r16173429 * r16173429;
        double r16173441 = r16173440 * r16173440;
        double r16173442 = r16173441 * r16173426;
        double r16173443 = r16173439 - r16173442;
        double r16173444 = r16173435 * r16173438;
        double r16173445 = r16173444 * r16173444;
        double r16173446 = r16173429 * r16173426;
        double r16173447 = r16173446 * r16173444;
        double r16173448 = r16173446 * r16173446;
        double r16173449 = r16173447 + r16173448;
        double r16173450 = r16173445 + r16173449;
        double r16173451 = r16173438 * r16173438;
        double r16173452 = r16173438 * r16173426;
        double r16173453 = r16173429 + r16173452;
        double r16173454 = r16173451 + r16173453;
        double r16173455 = r16173433 * r16173454;
        double r16173456 = r16173450 * r16173455;
        double r16173457 = r16173443 / r16173456;
        double r16173458 = -1.5;
        double r16173459 = r16173458 * r16173426;
        double r16173460 = 1.125;
        double r16173461 = r16173426 / r16173430;
        double r16173462 = r16173461 / r16173432;
        double r16173463 = r16173460 / r16173462;
        double r16173464 = r16173459 + r16173463;
        double r16173465 = r16173430 * r16173464;
        double r16173466 = r16173429 + r16173435;
        double r16173467 = r16173452 + r16173466;
        double r16173468 = r16173465 / r16173467;
        double r16173469 = r16173428 ? r16173457 : r16173468;
        return r16173469;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if b < 10.437713474112526

    1. Initial program 13.3

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

      \[\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 flip3--13.4

      \[\leadsto \frac{\color{blue}{\frac{{\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}^{3} - {b}^{3}}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(b \cdot b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot b\right)}}}{3 \cdot a}\]
    5. Applied associate-/l/13.4

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

      \[\leadsto \frac{\color{blue}{\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b \cdot \left(b \cdot b\right)}}{\left(3 \cdot a\right) \cdot \left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(b \cdot b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot b\right)\right)}\]
    7. Using strategy rm
    8. Applied flip3--12.8

      \[\leadsto \frac{\color{blue}{\frac{{\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}^{3} - {\left(b \cdot \left(b \cdot b\right)\right)}^{3}}{\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}}{\left(3 \cdot a\right) \cdot \left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(b \cdot b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot b\right)\right)}\]
    9. Applied associate-/l/12.8

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

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

    if 10.437713474112526 < b

    1. Initial program 32.7

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

      \[\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 flip3--32.8

      \[\leadsto \frac{\color{blue}{\frac{{\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}^{3} - {b}^{3}}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(b \cdot b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot b\right)}}}{3 \cdot a}\]
    5. Applied associate-/l/32.8

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

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

      \[\leadsto \frac{\color{blue}{\frac{27}{8} \cdot \frac{{a}^{2} \cdot {c}^{2}}{b} - \frac{9}{2} \cdot \left(a \cdot \left(b \cdot c\right)\right)}}{\left(3 \cdot a\right) \cdot \left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(b \cdot b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot b\right)\right)}\]
    8. Simplified8.1

      \[\leadsto \frac{\color{blue}{\frac{-9}{2} \cdot \left(\left(a \cdot c\right) \cdot b\right) + \frac{27}{8} \cdot \left(\frac{a \cdot c}{b} \cdot \left(a \cdot c\right)\right)}}{\left(3 \cdot a\right) \cdot \left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(b \cdot b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot b\right)\right)}\]
    9. Using strategy rm
    10. Applied associate-/r*8.1

      \[\leadsto \color{blue}{\frac{\frac{\frac{-9}{2} \cdot \left(\left(a \cdot c\right) \cdot b\right) + \frac{27}{8} \cdot \left(\frac{a \cdot c}{b} \cdot \left(a \cdot c\right)\right)}{3 \cdot a}}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(b \cdot b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot b\right)}}\]
    11. Simplified8.1

      \[\leadsto \frac{\frac{\frac{-9}{2} \cdot \left(\left(a \cdot c\right) \cdot b\right) + \frac{27}{8} \cdot \left(\frac{a \cdot c}{b} \cdot \left(a \cdot c\right)\right)}{3 \cdot a}}{\color{blue}{\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) + b \cdot b\right) + b \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
    12. Taylor expanded around inf 8.0

      \[\leadsto \frac{\color{blue}{\frac{9}{8} \cdot \frac{a \cdot {c}^{2}}{b} - \frac{3}{2} \cdot \left(b \cdot c\right)}}{\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) + b \cdot b\right) + b \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
    13. Simplified8.0

      \[\leadsto \frac{\color{blue}{c \cdot \left(\frac{\frac{9}{8}}{\frac{\frac{b}{c}}{a}} + \frac{-3}{2} \cdot b\right)}}{\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right) + b \cdot b\right) + b \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le 10.437713474112526:\\ \;\;\;\;\frac{\left(\left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} - \left(\left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot b}{\left(\left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) + \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot \left(\left(b \cdot b - c \cdot \left(3 \cdot a\right)\right) \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}\right) + \left(\left(b \cdot b\right) \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot b\right)\right)\right) \cdot \left(\left(3 \cdot a\right) \cdot \left(\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} + \left(b \cdot b + \sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot b\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot \left(\frac{-3}{2} \cdot b + \frac{\frac{9}{8}}{\frac{\frac{b}{c}}{a}}\right)}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} \cdot b + \left(b \cdot b + \left(b \cdot b - c \cdot \left(3 \cdot a\right)\right)\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019121 
(FPCore (a b c d)
  :name "Cubic critical, narrow range"
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))