Average Error: 28.6 → 0.4
Time: 5.0s
Precision: 64
\[1.05367121277235087 \cdot 10^{-8} \lt a \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt b \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt c \lt 94906265.6242515594\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{1}{2 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)} \cdot \left(4 \cdot c\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{2 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)} \cdot \left(4 \cdot c\right)
double f(double a, double b, double c) {
        double r33637 = b;
        double r33638 = -r33637;
        double r33639 = r33637 * r33637;
        double r33640 = 4.0;
        double r33641 = a;
        double r33642 = r33640 * r33641;
        double r33643 = c;
        double r33644 = r33642 * r33643;
        double r33645 = r33639 - r33644;
        double r33646 = sqrt(r33645);
        double r33647 = r33638 + r33646;
        double r33648 = 2.0;
        double r33649 = r33648 * r33641;
        double r33650 = r33647 / r33649;
        return r33650;
}

double f(double a, double b, double c) {
        double r33651 = 1.0;
        double r33652 = 2.0;
        double r33653 = b;
        double r33654 = -r33653;
        double r33655 = r33653 * r33653;
        double r33656 = 4.0;
        double r33657 = a;
        double r33658 = r33656 * r33657;
        double r33659 = c;
        double r33660 = r33658 * r33659;
        double r33661 = r33655 - r33660;
        double r33662 = sqrt(r33661);
        double r33663 = r33654 - r33662;
        double r33664 = r33652 * r33663;
        double r33665 = r33651 / r33664;
        double r33666 = r33656 * r33659;
        double r33667 = r33665 * r33666;
        return r33667;
}

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 28.6

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

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

    \[\leadsto \frac{\frac{\color{blue}{0 + 4 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}}{2 \cdot a}\]
  7. Applied *-un-lft-identity0.5

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(0 + 4 \cdot \left(a \cdot c\right)\right)}}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}{2 \cdot a}\]
  8. Applied times-frac0.5

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

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

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{\frac{2 \cdot a}{4 \cdot \left(a \cdot c\right)} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  11. Using strategy rm
  12. Applied times-frac0.5

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{\left(\frac{2}{4} \cdot \frac{a}{a \cdot c}\right)} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}\]
  13. Applied associate-*l*0.5

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

    \[\leadsto \frac{\frac{1}{1}}{\frac{2}{4} \cdot \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{c}}}\]
  15. Using strategy rm
  16. Applied frac-times0.4

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{\frac{2 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}{4 \cdot c}}}\]
  17. Applied associate-/r/0.4

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

    \[\leadsto \color{blue}{\frac{1}{2 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}} \cdot \left(4 \cdot c\right)\]
  19. Final simplification0.4

    \[\leadsto \frac{1}{2 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)} \cdot \left(4 \cdot c\right)\]

Reproduce

herbie shell --seed 2020065 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))