Average Error: 28.7 → 24.7
Time: 3.0m
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}\]
\[\frac{\frac{\frac{\left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right) - b \cdot \left(b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(b \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right)\right)} + \sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right)}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)\right)\right)}}{a \cdot 3}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\frac{\left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right) - b \cdot \left(b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(b \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right)\right)} + \sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right)}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)\right)\right)}}{a \cdot 3}
double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r22348735 = b;
        double r22348736 = -r22348735;
        double r22348737 = r22348735 * r22348735;
        double r22348738 = 3.0;
        double r22348739 = a;
        double r22348740 = r22348738 * r22348739;
        double r22348741 = c;
        double r22348742 = r22348740 * r22348741;
        double r22348743 = r22348737 - r22348742;
        double r22348744 = sqrt(r22348743);
        double r22348745 = r22348736 + r22348744;
        double r22348746 = r22348745 / r22348740;
        return r22348746;
}

double f(double a, double b, double c, double __attribute__((unused)) d) {
        double r22348747 = b;
        double r22348748 = r22348747 * r22348747;
        double r22348749 = r22348747 * r22348748;
        double r22348750 = r22348749 * r22348749;
        double r22348751 = -3.0;
        double r22348752 = c;
        double r22348753 = a;
        double r22348754 = r22348752 * r22348753;
        double r22348755 = fma(r22348751, r22348754, r22348748);
        double r22348756 = sqrt(r22348755);
        double r22348757 = r22348754 * r22348751;
        double r22348758 = r22348756 * r22348757;
        double r22348759 = r22348756 * r22348748;
        double r22348760 = r22348759 - r22348749;
        double r22348761 = r22348758 + r22348760;
        double r22348762 = r22348750 * r22348761;
        double r22348763 = fma(r22348754, r22348751, r22348748);
        double r22348764 = sqrt(r22348763);
        double r22348765 = r22348764 * r22348748;
        double r22348766 = r22348765 * r22348765;
        double r22348767 = r22348749 * r22348765;
        double r22348768 = r22348750 + r22348767;
        double r22348769 = r22348766 + r22348768;
        double r22348770 = r22348762 / r22348769;
        double r22348771 = r22348764 * r22348757;
        double r22348772 = r22348770 + r22348771;
        double r22348773 = r22348751 * r22348753;
        double r22348774 = fma(r22348752, r22348773, r22348748);
        double r22348775 = sqrt(r22348774);
        double r22348776 = r22348748 + r22348774;
        double r22348777 = fma(r22348747, r22348775, r22348776);
        double r22348778 = r22348772 / r22348777;
        double r22348779 = 3.0;
        double r22348780 = r22348753 * r22348779;
        double r22348781 = r22348778 / r22348780;
        return r22348781;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Derivation

  1. Initial program 28.7

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

    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied flip3--28.7

    \[\leadsto \frac{\color{blue}{\frac{{\left(\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}\right)}^{3} - {b}^{3}}{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} \cdot \sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} + \left(b \cdot b + \sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} \cdot b\right)}}}{3 \cdot a}\]
  5. Simplified28.1

    \[\leadsto \frac{\frac{\color{blue}{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right) - b \cdot \left(b \cdot b\right)}}{\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} \cdot \sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} + \left(b \cdot b + \sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)} \cdot b\right)}}{3 \cdot a}\]
  6. Simplified28.1

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

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot -3 + b \cdot b\right)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  9. Applied distribute-lft-in27.9

    \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  10. Applied associate--l+26.2

    \[\leadsto \frac{\frac{\color{blue}{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right) - b \cdot \left(b \cdot b\right)\right)}}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  11. Using strategy rm
  12. Applied flip3--26.3

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \color{blue}{\frac{{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right)}^{3} - {\left(b \cdot \left(b \cdot b\right)\right)}^{3}}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  13. Simplified25.2

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \frac{\color{blue}{\left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right) - b \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  14. Using strategy rm
  15. Applied fma-udef25.2

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \frac{\left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \color{blue}{\left(-3 \cdot \left(c \cdot a\right) + b \cdot b\right)} - b \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  16. Applied distribute-rgt-in25.1

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \frac{\left(\color{blue}{\left(\left(-3 \cdot \left(c \cdot a\right)\right) \cdot \sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} + \left(b \cdot b\right) \cdot \sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)}\right)} - b \cdot \left(b \cdot b\right)\right) \cdot \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  17. Applied associate--l+24.7

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \frac{\color{blue}{\left(\left(-3 \cdot \left(c \cdot a\right)\right) \cdot \sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} + \left(\left(b \cdot b\right) \cdot \sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} - b \cdot \left(b \cdot b\right)\right)\right)} \cdot \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(a \cdot -3\right), \left(b \cdot b\right)\right)\right)\right)}}{3 \cdot a}\]
  18. Final simplification24.7

    \[\leadsto \frac{\frac{\frac{\left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right) + \left(\sqrt{\mathsf{fma}\left(-3, \left(c \cdot a\right), \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right) - b \cdot \left(b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right) + \left(\left(b \cdot \left(b \cdot b\right)\right) \cdot \left(b \cdot \left(b \cdot b\right)\right) + \left(b \cdot \left(b \cdot b\right)\right) \cdot \left(\sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(b \cdot b\right)\right)\right)} + \sqrt{\mathsf{fma}\left(\left(c \cdot a\right), -3, \left(b \cdot b\right)\right)} \cdot \left(\left(c \cdot a\right) \cdot -3\right)}{\mathsf{fma}\left(b, \left(\sqrt{\mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)}\right), \left(b \cdot b + \mathsf{fma}\left(c, \left(-3 \cdot a\right), \left(b \cdot b\right)\right)\right)\right)}}{a \cdot 3}\]

Reproduce

herbie shell --seed 2019128 +o rules:numerics
(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)))