\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.0095:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + \left(a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right) + \left({a}^{2} \cdot \left(-0.5625 \cdot \frac{{c}^{3}}{{b}^{5}}\right) + {c}^{4} \cdot \left(\frac{{a}^{3}}{{b}^{7}} \cdot -1.0546875\right)\right)\right)\\
\end{array}
\]
(FPCore (a b c)
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a))) ↓
(FPCore (a b c)
:precision binary64
(if (<= b 0.0095)
(*
(+ (- b) (sqrt (- (* b b) (* c (/ a 0.3333333333333333)))))
(/ 0.3333333333333333 a))
(+
(* -0.5 (/ c b))
(+
(* a (* (/ (pow c 2.0) (pow b 3.0)) -0.375))
(+
(* (pow a 2.0) (* -0.5625 (/ (pow c 3.0) (pow b 5.0))))
(* (pow c 4.0) (* (/ (pow a 3.0) (pow b 7.0)) -1.0546875))))))) double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
↓
double code(double a, double b, double c) {
double tmp;
if (b <= 0.0095) {
tmp = (-b + sqrt(((b * b) - (c * (a / 0.3333333333333333))))) * (0.3333333333333333 / a);
} else {
tmp = (-0.5 * (c / b)) + ((a * ((pow(c, 2.0) / pow(b, 3.0)) * -0.375)) + ((pow(a, 2.0) * (-0.5625 * (pow(c, 3.0) / pow(b, 5.0)))) + (pow(c, 4.0) * ((pow(a, 3.0) / pow(b, 7.0)) * -1.0546875))));
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
↓
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 0.0095d0) then
tmp = (-b + sqrt(((b * b) - (c * (a / 0.3333333333333333d0))))) * (0.3333333333333333d0 / a)
else
tmp = ((-0.5d0) * (c / b)) + ((a * (((c ** 2.0d0) / (b ** 3.0d0)) * (-0.375d0))) + (((a ** 2.0d0) * ((-0.5625d0) * ((c ** 3.0d0) / (b ** 5.0d0)))) + ((c ** 4.0d0) * (((a ** 3.0d0) / (b ** 7.0d0)) * (-1.0546875d0)))))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
↓
public static double code(double a, double b, double c) {
double tmp;
if (b <= 0.0095) {
tmp = (-b + Math.sqrt(((b * b) - (c * (a / 0.3333333333333333))))) * (0.3333333333333333 / a);
} else {
tmp = (-0.5 * (c / b)) + ((a * ((Math.pow(c, 2.0) / Math.pow(b, 3.0)) * -0.375)) + ((Math.pow(a, 2.0) * (-0.5625 * (Math.pow(c, 3.0) / Math.pow(b, 5.0)))) + (Math.pow(c, 4.0) * ((Math.pow(a, 3.0) / Math.pow(b, 7.0)) * -1.0546875))));
}
return tmp;
}
def code(a, b, c):
return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
↓
def code(a, b, c):
tmp = 0
if b <= 0.0095:
tmp = (-b + math.sqrt(((b * b) - (c * (a / 0.3333333333333333))))) * (0.3333333333333333 / a)
else:
tmp = (-0.5 * (c / b)) + ((a * ((math.pow(c, 2.0) / math.pow(b, 3.0)) * -0.375)) + ((math.pow(a, 2.0) * (-0.5625 * (math.pow(c, 3.0) / math.pow(b, 5.0)))) + (math.pow(c, 4.0) * ((math.pow(a, 3.0) / math.pow(b, 7.0)) * -1.0546875))))
return tmp
function code(a, b, c)
return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
↓
function code(a, b, c)
tmp = 0.0
if (b <= 0.0095)
tmp = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(c * Float64(a / 0.3333333333333333))))) * Float64(0.3333333333333333 / a));
else
tmp = Float64(Float64(-0.5 * Float64(c / b)) + Float64(Float64(a * Float64(Float64((c ^ 2.0) / (b ^ 3.0)) * -0.375)) + Float64(Float64((a ^ 2.0) * Float64(-0.5625 * Float64((c ^ 3.0) / (b ^ 5.0)))) + Float64((c ^ 4.0) * Float64(Float64((a ^ 3.0) / (b ^ 7.0)) * -1.0546875)))));
end
return tmp
end
function tmp = code(a, b, c)
tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
end
↓
function tmp_2 = code(a, b, c)
tmp = 0.0;
if (b <= 0.0095)
tmp = (-b + sqrt(((b * b) - (c * (a / 0.3333333333333333))))) * (0.3333333333333333 / a);
else
tmp = (-0.5 * (c / b)) + ((a * (((c ^ 2.0) / (b ^ 3.0)) * -0.375)) + (((a ^ 2.0) * (-0.5625 * ((c ^ 3.0) / (b ^ 5.0)))) + ((c ^ 4.0) * (((a ^ 3.0) / (b ^ 7.0)) * -1.0546875))));
end
tmp_2 = tmp;
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
↓
code[a_, b_, c_] := If[LessEqual[b, 0.0095], N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] * -0.375), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[(-0.5625 * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[c, 4.0], $MachinePrecision] * N[(N[(N[Power[a, 3.0], $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision] * -1.0546875), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
↓
\begin{array}{l}
\mathbf{if}\;b \leq 0.0095:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + \left(a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right) + \left({a}^{2} \cdot \left(-0.5625 \cdot \frac{{c}^{3}}{{b}^{5}}\right) + {c}^{4} \cdot \left(\frac{{a}^{3}}{{b}^{7}} \cdot -1.0546875\right)\right)\right)\\
\end{array}
Alternatives Alternative 1 Error 5.0 Cost 47492
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.011:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right) + \left(-0.5 \cdot \frac{c}{b} + \left({a}^{2} \cdot \left(-0.5625 \cdot \frac{{c}^{3}}{{b}^{5}}\right) + -0.16666666666666666 \cdot \frac{{\left(c \cdot a\right)}^{4} \cdot 6.328125}{a \cdot {b}^{7}}\right)\right)\\
\end{array}
\]
Alternative 2 Error 5.0 Cost 47492
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.0092:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \left({c}^{2} \cdot \frac{a}{{b}^{3}}\right) + -0.5625 \cdot \left({c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}\right)\right)\right) + -0.16666666666666666 \cdot \frac{{\left(c \cdot a\right)}^{4} \cdot 6.328125}{a \cdot {b}^{7}}\\
\end{array}
\]
Alternative 3 Error 5.3 Cost 41284
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.01:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot \left(\frac{a}{b} \cdot -1.5\right) + \left(-0.5 \cdot \frac{{\left(c \cdot a\right)}^{4} \cdot 6.328125}{{b}^{7}} + \left(-1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + -1.6875 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}}\right)\right)\right) \cdot \frac{0.3333333333333333}{a}\\
\end{array}
\]
Alternative 4 Error 5.2 Cost 41284
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.011:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(-1.5 \cdot \frac{c}{b}\right) + \left(-0.5 \cdot \frac{{\left(c \cdot a\right)}^{4} \cdot 6.328125}{{b}^{7}} + \left(-1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + -1.6875 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}}\right)\right)}{3 \cdot a}\\
\end{array}
\]
Alternative 5 Error 6.7 Cost 33796
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.011:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)\\
\end{array}
\]
Alternative 6 Error 6.7 Cost 33796
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.011:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + \left(a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right) + {a}^{2} \cdot \left(-0.5625 \cdot \frac{{c}^{3}}{{b}^{5}}\right)\right)\\
\end{array}
\]
Alternative 7 Error 7.0 Cost 27716
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.011:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(-1.5 \cdot \frac{c}{\frac{b}{a}} + \left(-1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + -1.6875 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}}\right)\right) \cdot \frac{0.3333333333333333}{a}\\
\end{array}
\]
Alternative 8 Error 7.0 Cost 27716
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.011:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(-1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + \left(-1.5 \cdot \frac{a}{\frac{b}{c}} + -1.6875 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}}\right)\right)\\
\end{array}
\]
Alternative 9 Error 7.0 Cost 27716
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.011:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}} + \left(-1.5 \cdot \frac{a}{\frac{b}{c}} + -1.6875 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}}\right)}{a} \cdot 0.3333333333333333\\
\end{array}
\]
Alternative 10 Error 6.9 Cost 27716
\[\begin{array}{l}
\mathbf{if}\;b \leq 0.0105:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1.5 \cdot \left(a \cdot \frac{c}{b}\right) + \left(-1.6875 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}} + -1.125 \cdot \frac{{\left(c \cdot a\right)}^{2}}{{b}^{3}}\right)}{3 \cdot a}\\
\end{array}
\]
Alternative 11 Error 9.7 Cost 13892
\[\begin{array}{l}
\mathbf{if}\;b \leq 106:\\
\;\;\;\;\frac{2}{\frac{a \cdot 6}{\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + a \cdot \left(\frac{{c}^{2}}{{b}^{3}} \cdot -0.375\right)\\
\end{array}
\]
Alternative 12 Error 16.9 Cost 7684
\[\begin{array}{l}
\mathbf{if}\;b \leq 1800:\\
\;\;\;\;\frac{2}{\frac{a \cdot 6}{\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\]
Alternative 13 Error 16.9 Cost 7556
\[\begin{array}{l}
\mathbf{if}\;b \leq 1800:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\]
Alternative 14 Error 16.9 Cost 7556
\[\begin{array}{l}
\mathbf{if}\;b \leq 1800:\\
\;\;\;\;\left(\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\]
Alternative 15 Error 16.9 Cost 7556
\[\begin{array}{l}
\mathbf{if}\;b \leq 1800:\\
\;\;\;\;\frac{\frac{\left(-b\right) + \sqrt{b \cdot b - c \cdot \frac{a}{0.3333333333333333}}}{3}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\]
Alternative 16 Error 22.6 Cost 320
\[-0.5 \cdot \frac{c}{b}
\]