Average Error: 28.5 → 25.0
Time: 36.4s
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(c, -3 \cdot a, b \cdot b\right) \cdot \sqrt{\mathsf{fma}\left(c, -3 \cdot a, b \cdot b\right)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(c, -3 \cdot a, b \cdot b\right) + \mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(c, -3 \cdot a, b \cdot b\right)}, b \cdot b\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(c, -3 \cdot a, b \cdot b\right) \cdot \sqrt{\mathsf{fma}\left(c, -3 \cdot a, b \cdot b\right)} - b \cdot \left(b \cdot b\right)}{\mathsf{fma}\left(c, -3 \cdot a, b \cdot b\right) + \mathsf{fma}\left(b, \sqrt{\mathsf{fma}\left(c, -3 \cdot a, b \cdot b\right)}, b \cdot b\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 r3509106 = b;
        double r3509107 = -r3509106;
        double r3509108 = r3509106 * r3509106;
        double r3509109 = 3.0;
        double r3509110 = a;
        double r3509111 = r3509109 * r3509110;
        double r3509112 = c;
        double r3509113 = r3509111 * r3509112;
        double r3509114 = r3509108 - r3509113;
        double r3509115 = sqrt(r3509114);
        double r3509116 = r3509107 + r3509115;
        double r3509117 = r3509116 / r3509111;
        return r3509117;
}

double f(double a, double b, double c) {
        double r3509118 = b;
        double r3509119 = r3509118 * r3509118;
        double r3509120 = c;
        double r3509121 = -3.0;
        double r3509122 = a;
        double r3509123 = r3509121 * r3509122;
        double r3509124 = fma(r3509120, r3509123, r3509119);
        double r3509125 = sqrt(r3509124);
        double r3509126 = r3509124 * r3509125;
        double r3509127 = r3509118 * r3509119;
        double r3509128 = r3509126 - r3509127;
        double r3509129 = fma(r3509118, r3509125, r3509119);
        double r3509130 = r3509124 + r3509129;
        double r3509131 = r3509128 / r3509130;
        double r3509132 = r3509119 * r3509131;
        double r3509133 = r3509122 * r3509120;
        double r3509134 = fma(r3509133, r3509121, r3509119);
        double r3509135 = sqrt(r3509134);
        double r3509136 = r3509133 * r3509121;
        double r3509137 = r3509135 * r3509136;
        double r3509138 = r3509132 + r3509137;
        double r3509139 = r3509119 + r3509134;
        double r3509140 = fma(r3509135, r3509118, r3509139);
        double r3509141 = r3509138 / r3509140;
        double r3509142 = 3.0;
        double r3509143 = r3509122 * r3509142;
        double r3509144 = r3509141 / r3509143;
        return r3509144;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 28.5

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

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

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

    \[\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. Simplified27.9

    \[\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-udef27.9

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

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

    \[\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 distribute-rgt-out--25.5

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

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

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

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