Average Error: 43.9 → 0.2
Time: 10.8s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{c}{-\left(b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{c}{-\left(b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}
double f(double a, double b, double c) {
        double r53807 = b;
        double r53808 = -r53807;
        double r53809 = r53807 * r53807;
        double r53810 = 3.0;
        double r53811 = a;
        double r53812 = r53810 * r53811;
        double r53813 = c;
        double r53814 = r53812 * r53813;
        double r53815 = r53809 - r53814;
        double r53816 = sqrt(r53815);
        double r53817 = r53808 + r53816;
        double r53818 = r53817 / r53812;
        return r53818;
}

double f(double a, double b, double c) {
        double r53819 = c;
        double r53820 = b;
        double r53821 = r53820 * r53820;
        double r53822 = 3.0;
        double r53823 = a;
        double r53824 = r53822 * r53823;
        double r53825 = r53824 * r53819;
        double r53826 = r53821 - r53825;
        double r53827 = sqrt(r53826);
        double r53828 = r53820 + r53827;
        double r53829 = -r53828;
        double r53830 = r53819 / r53829;
        return r53830;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 43.9

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+43.9

    \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  4. Simplified0.6

    \[\leadsto \frac{\frac{\color{blue}{0 + 3 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  5. Using strategy rm
  6. Applied associate-*r*0.4

    \[\leadsto \frac{\frac{0 + \color{blue}{\left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  7. Using strategy rm
  8. Applied div-inv0.5

    \[\leadsto \frac{\color{blue}{\left(0 + \left(3 \cdot a\right) \cdot c\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  9. Applied associate-/l*0.5

    \[\leadsto \color{blue}{\frac{0 + \left(3 \cdot a\right) \cdot c}{\frac{3 \cdot a}{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}\]
  10. Simplified0.4

    \[\leadsto \frac{0 + \left(3 \cdot a\right) \cdot c}{\color{blue}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  11. Using strategy rm
  12. Applied sub-neg0.4

    \[\leadsto \frac{0 + \left(3 \cdot a\right) \cdot c}{\left(3 \cdot a\right) \cdot \color{blue}{\left(\left(-b\right) + \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)\right)}}\]
  13. Applied distribute-lft-in0.4

    \[\leadsto \frac{0 + \left(3 \cdot a\right) \cdot c}{\color{blue}{\left(3 \cdot a\right) \cdot \left(-b\right) + \left(3 \cdot a\right) \cdot \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  14. Final simplification0.2

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

Reproduce

herbie shell --seed 2019304 
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e15) (< 1.11022e-16 b 9.0072e15) (< 1.11022e-16 c 9.0072e15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))