Average Error: 29.1 → 25.6
Time: 30.8s
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{\left(b \cdot b\right) \cdot \frac{\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)}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)} + b, \mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)\right)} + \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\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)}}{a \cdot 3}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{\left(b \cdot b\right) \cdot \frac{\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)}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)} + b, \mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)\right)} + \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\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)}}{a \cdot 3}
double f(double a, double b, double c) {
        double r1588042 = b;
        double r1588043 = -r1588042;
        double r1588044 = r1588042 * r1588042;
        double r1588045 = 3.0;
        double r1588046 = a;
        double r1588047 = r1588045 * r1588046;
        double r1588048 = c;
        double r1588049 = r1588047 * r1588048;
        double r1588050 = r1588044 - r1588049;
        double r1588051 = sqrt(r1588050);
        double r1588052 = r1588043 + r1588051;
        double r1588053 = r1588052 / r1588047;
        return r1588053;
}

double f(double a, double b, double c) {
        double r1588054 = b;
        double r1588055 = r1588054 * r1588054;
        double r1588056 = a;
        double r1588057 = -3.0;
        double r1588058 = c;
        double r1588059 = r1588057 * r1588058;
        double r1588060 = fma(r1588056, r1588059, r1588055);
        double r1588061 = sqrt(r1588060);
        double r1588062 = r1588060 * r1588061;
        double r1588063 = r1588054 * r1588055;
        double r1588064 = r1588062 - r1588063;
        double r1588065 = r1588061 + r1588054;
        double r1588066 = fma(r1588054, r1588065, r1588060);
        double r1588067 = r1588064 / r1588066;
        double r1588068 = r1588055 * r1588067;
        double r1588069 = r1588056 * r1588058;
        double r1588070 = fma(r1588069, r1588057, r1588055);
        double r1588071 = sqrt(r1588070);
        double r1588072 = r1588069 * r1588057;
        double r1588073 = r1588071 * r1588072;
        double r1588074 = r1588068 + r1588073;
        double r1588075 = r1588055 + r1588070;
        double r1588076 = fma(r1588071, r1588054, r1588075);
        double r1588077 = r1588074 / r1588076;
        double r1588078 = 3.0;
        double r1588079 = r1588056 * r1588078;
        double r1588080 = r1588077 / r1588079;
        return r1588080;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 29.1

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

    \[\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--29.2

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

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

    \[\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, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)\right)}}}{3 \cdot a}\]
  7. Using strategy rm
  8. Applied fma-udef28.5

    \[\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, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)\right)}}{3 \cdot a}\]
  9. Applied distribute-lft-in28.4

    \[\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, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)\right)}}{3 \cdot a}\]
  10. Applied associate--l+26.6

    \[\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, b \cdot b + \mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)\right)}}{3 \cdot a}\]
  11. Using strategy rm
  12. Applied distribute-rgt-out--26.1

    \[\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(b \cdot b\right) \cdot \left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} - b\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}\]
  13. Using strategy rm
  14. Applied flip3--26.2

    \[\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(b \cdot b\right) \cdot \color{blue}{\frac{{\left(\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)}\right)}^{3} - {b}^{3}}{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} + \left(b \cdot b + \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot b\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}\]
  15. Simplified25.6

    \[\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(b \cdot b\right) \cdot \frac{\color{blue}{\sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)} \cdot \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right) - \left(b \cdot b\right) \cdot b}}{\sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} + \left(b \cdot b + \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot b\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}\]
  16. Simplified25.6

    \[\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(b \cdot b\right) \cdot \frac{\sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)} \cdot \mathsf{fma}\left(a, c \cdot -3, b \cdot b\right) - \left(b \cdot b\right) \cdot b}{\color{blue}{\mathsf{fma}\left(b, b + \sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)}, \mathsf{fma}\left(a, c \cdot -3, b \cdot b\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}\]
  17. Final simplification25.6

    \[\leadsto \frac{\frac{\left(b \cdot b\right) \cdot \frac{\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)}{\mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)} + b, \mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)\right)} + \sqrt{\mathsf{fma}\left(a \cdot c, -3, b \cdot b\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\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)}}{a \cdot 3}\]

Reproduce

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