Average Error: 28.8 → 25.8
Time: 38.0s
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{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\right) + \left(\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b \cdot b, \left(-b\right) \cdot \left(b \cdot b\right)\right) + \sqrt[3]{\left(\mathsf{fma}\left(\left(-b\right) \cdot b, b, b \cdot \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(\left(-b\right) \cdot b, b, b \cdot \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(\left(-b\right) \cdot b, b, b \cdot \left(b \cdot b\right)\right)}\right)}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)\right)}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\right) + \left(\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b \cdot b, \left(-b\right) \cdot \left(b \cdot b\right)\right) + \sqrt[3]{\left(\mathsf{fma}\left(\left(-b\right) \cdot b, b, b \cdot \left(b \cdot b\right)\right) \cdot \mathsf{fma}\left(\left(-b\right) \cdot b, b, b \cdot \left(b \cdot b\right)\right)\right) \cdot \mathsf{fma}\left(\left(-b\right) \cdot b, b, b \cdot \left(b \cdot b\right)\right)}\right)}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}, b, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)\right)}}{3 \cdot a}
double f(double a, double b, double c) {
        double r4744604 = b;
        double r4744605 = -r4744604;
        double r4744606 = r4744604 * r4744604;
        double r4744607 = 3.0;
        double r4744608 = a;
        double r4744609 = r4744607 * r4744608;
        double r4744610 = c;
        double r4744611 = r4744609 * r4744610;
        double r4744612 = r4744606 - r4744611;
        double r4744613 = sqrt(r4744612);
        double r4744614 = r4744605 + r4744613;
        double r4744615 = r4744614 / r4744609;
        return r4744615;
}

double f(double a, double b, double c) {
        double r4744616 = a;
        double r4744617 = c;
        double r4744618 = r4744616 * r4744617;
        double r4744619 = -3.0;
        double r4744620 = b;
        double r4744621 = r4744620 * r4744620;
        double r4744622 = fma(r4744618, r4744619, r4744621);
        double r4744623 = sqrt(r4744622);
        double r4744624 = r4744618 * r4744619;
        double r4744625 = r4744623 * r4744624;
        double r4744626 = -r4744620;
        double r4744627 = r4744626 * r4744621;
        double r4744628 = fma(r4744623, r4744621, r4744627);
        double r4744629 = r4744626 * r4744620;
        double r4744630 = r4744620 * r4744621;
        double r4744631 = fma(r4744629, r4744620, r4744630);
        double r4744632 = r4744631 * r4744631;
        double r4744633 = r4744632 * r4744631;
        double r4744634 = cbrt(r4744633);
        double r4744635 = r4744628 + r4744634;
        double r4744636 = r4744625 + r4744635;
        double r4744637 = r4744621 + r4744622;
        double r4744638 = fma(r4744623, r4744620, r4744637);
        double r4744639 = r4744636 / r4744638;
        double r4744640 = 3.0;
        double r4744641 = r4744640 * r4744616;
        double r4744642 = r4744639 / r4744641;
        return r4744642;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.8

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

    \[\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.8

    \[\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. Simplified28.2

    \[\leadsto \frac{\frac{\color{blue}{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right) - b \cdot \left(b \cdot b\right)}}{\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. Simplified28.2

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019163 +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)))