Average Error: 28.8 → 0.4
Time: 6.0s
Precision: binary64
\[1.0536712127723509 \cdot 10^{-08} < a \land a < 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} < b \land b < 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} < c \land c < 94906265.62425156\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{-\frac{a}{a}}{\frac{b + \sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c}}{c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{-\frac{a}{a}}{\frac{b + \sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c}}{c}}
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
(FPCore (a b c)
 :precision binary64
 (/ (- (/ a a)) (/ (+ b (sqrt (- (* b b) (* (* a 3.0) c)))) c)))
double code(double a, double b, double c) {
	return (((double) (((double) -(b)) + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (3.0 * a)) * c)))))))) / ((double) (3.0 * a)));
}
double code(double a, double b, double c) {
	return (((double) -((a / a))) / (((double) (b + ((double) sqrt(((double) (((double) (b * b)) - ((double) (((double) (a * 3.0)) * c)))))))) / c));
}

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.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{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied flip--_binary6428.8

    \[\leadsto \frac{\color{blue}{\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b \cdot b}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + b}}}{3 \cdot a}\]
  5. Simplified27.8

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

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

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

    \[\leadsto \frac{\frac{1}{\color{blue}{\frac{b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-\left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  10. Using strategy rm
  11. Applied distribute-lft-neg-in_binary640.5

    \[\leadsto \frac{\frac{1}{\frac{b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\color{blue}{\left(-3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  12. Applied *-un-lft-identity_binary640.5

    \[\leadsto \frac{\frac{1}{\frac{\color{blue}{1 \cdot \left(b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{\left(-3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  13. Applied times-frac_binary640.6

    \[\leadsto \frac{\frac{1}{\color{blue}{\frac{1}{-3 \cdot a} \cdot \frac{b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}}}{3 \cdot a}\]
  14. Applied *-un-lft-identity_binary640.6

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot 1}}{\frac{1}{-3 \cdot a} \cdot \frac{b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}}{3 \cdot a}\]
  15. Applied times-frac_binary640.5

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

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

    \[\leadsto \frac{\frac{1}{\frac{1}{-3 \cdot a}}}{\color{blue}{\left(3 \cdot a\right) \cdot \frac{b + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{c}}}\]
  18. Using strategy rm
  19. Applied associate-/r*_binary640.5

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

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

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

Reproduce

herbie shell --seed 2020210 
(FPCore (a b c)
  :name "Cubic critical, 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) (* (* 3.0 a) c)))) (* 3.0 a)))