Average Error: 28.4 → 24.7
Time: 41.5s
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(b \cdot b\right) \cdot \left(\mathsf{fma}\left(-b \cdot b, b, b \cdot \left(b \cdot b\right)\right) + \mathsf{fma}\left(\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right), \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}, b \cdot \left(-b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot b + b \cdot b\right) + \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}} + \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot \left(\left(-3 \cdot c\right) \cdot a\right)}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}, b, b \cdot b\right) + \mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\frac{\left(b \cdot b\right) \cdot \left(\mathsf{fma}\left(-b \cdot b, b, b \cdot \left(b \cdot b\right)\right) + \mathsf{fma}\left(\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right), \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}, b \cdot \left(-b \cdot b\right)\right)\right)}{\left(\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot b + b \cdot b\right) + \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}} + \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot \left(\left(-3 \cdot c\right) \cdot a\right)}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}, b, b \cdot b\right) + \mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}}{3 \cdot a}
double f(double a, double b, double c) {
        double r2880777 = b;
        double r2880778 = -r2880777;
        double r2880779 = r2880777 * r2880777;
        double r2880780 = 3.0;
        double r2880781 = a;
        double r2880782 = r2880780 * r2880781;
        double r2880783 = c;
        double r2880784 = r2880782 * r2880783;
        double r2880785 = r2880779 - r2880784;
        double r2880786 = sqrt(r2880785);
        double r2880787 = r2880778 + r2880786;
        double r2880788 = r2880787 / r2880782;
        return r2880788;
}

double f(double a, double b, double c) {
        double r2880789 = b;
        double r2880790 = r2880789 * r2880789;
        double r2880791 = -r2880790;
        double r2880792 = r2880789 * r2880790;
        double r2880793 = fma(r2880791, r2880789, r2880792);
        double r2880794 = a;
        double r2880795 = -3.0;
        double r2880796 = c;
        double r2880797 = r2880795 * r2880796;
        double r2880798 = fma(r2880794, r2880797, r2880790);
        double r2880799 = sqrt(r2880798);
        double r2880800 = r2880789 * r2880791;
        double r2880801 = fma(r2880798, r2880799, r2880800);
        double r2880802 = r2880793 + r2880801;
        double r2880803 = r2880790 * r2880802;
        double r2880804 = fma(r2880797, r2880794, r2880790);
        double r2880805 = sqrt(r2880804);
        double r2880806 = r2880805 * r2880789;
        double r2880807 = r2880806 + r2880790;
        double r2880808 = r2880805 * r2880805;
        double r2880809 = r2880807 + r2880808;
        double r2880810 = r2880803 / r2880809;
        double r2880811 = r2880797 * r2880794;
        double r2880812 = r2880805 * r2880811;
        double r2880813 = r2880810 + r2880812;
        double r2880814 = fma(r2880805, r2880789, r2880790);
        double r2880815 = r2880814 + r2880804;
        double r2880816 = r2880813 / r2880815;
        double r2880817 = 3.0;
        double r2880818 = r2880817 * r2880794;
        double r2880819 = r2880816 / r2880818;
        return r2880819;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.4

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot \left(\left(-3 \cdot c\right) \cdot a\right) + \left(b \cdot b\right) \cdot \color{blue}{\frac{{\left(\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}\right)}^{3} - {b}^{3}}{\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} + \left(b \cdot b + \sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)} \cdot b\right)}}}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}, b, b \cdot b\right) + \mathsf{fma}\left(-3 \cdot c, a, b \cdot b\right)}}{3 \cdot a}\]
  14. Applied associate-*r/25.6

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

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

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

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

Reproduce

herbie shell --seed 2019138 +o rules:numerics
(FPCore (a b c)
  :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)))