
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
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
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
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 tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); 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]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
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
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
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 tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); 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]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -4.5e+28)
(* (/ b a) -0.6666666666666666)
(if (<= b 4.4e-97)
(/ (- (sqrt (* c (+ (* a -3.0) (/ (pow b 2.0) c)))) b) (* a 3.0))
(/ 1.0 (* b (- (/ (* a 1.5) (pow b 2.0)) (/ 2.0 c)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e+28) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 4.4e-97) {
tmp = (sqrt((c * ((a * -3.0) + (pow(b, 2.0) / c)))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
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 <= (-4.5d+28)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 4.4d-97) then
tmp = (sqrt((c * ((a * (-3.0d0)) + ((b ** 2.0d0) / c)))) - b) / (a * 3.0d0)
else
tmp = 1.0d0 / (b * (((a * 1.5d0) / (b ** 2.0d0)) - (2.0d0 / c)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e+28) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 4.4e-97) {
tmp = (Math.sqrt((c * ((a * -3.0) + (Math.pow(b, 2.0) / c)))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / Math.pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.5e+28: tmp = (b / a) * -0.6666666666666666 elif b <= 4.4e-97: tmp = (math.sqrt((c * ((a * -3.0) + (math.pow(b, 2.0) / c)))) - b) / (a * 3.0) else: tmp = 1.0 / (b * (((a * 1.5) / math.pow(b, 2.0)) - (2.0 / c))) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.5e+28) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 4.4e-97) tmp = Float64(Float64(sqrt(Float64(c * Float64(Float64(a * -3.0) + Float64((b ^ 2.0) / c)))) - b) / Float64(a * 3.0)); else tmp = Float64(1.0 / Float64(b * Float64(Float64(Float64(a * 1.5) / (b ^ 2.0)) - Float64(2.0 / c)))); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.5e+28) tmp = (b / a) * -0.6666666666666666; elseif (b <= 4.4e-97) tmp = (sqrt((c * ((a * -3.0) + ((b ^ 2.0) / c)))) - b) / (a * 3.0); else tmp = 1.0 / (b * (((a * 1.5) / (b ^ 2.0)) - (2.0 / c))); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+28], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 4.4e-97], N[(N[(N[Sqrt[N[(c * N[(N[(a * -3.0), $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b * N[(N[(N[(a * 1.5), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-97}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3 + \frac{{b}^{2}}{c}\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{b \cdot \left(\frac{a \cdot 1.5}{{b}^{2}} - \frac{2}{c}\right)}\\
\end{array}
\end{array}
if b < -4.4999999999999997e28Initial program 56.9%
Simplified56.9%
Taylor expanded in b around -inf 92.9%
*-commutative92.9%
Simplified92.9%
if -4.4999999999999997e28 < b < 4.3999999999999998e-97Initial program 85.7%
Simplified85.7%
Taylor expanded in c around inf 85.7%
if 4.3999999999999998e-97 < b Initial program 16.9%
add-cube-cbrt16.9%
pow316.9%
Applied egg-rr16.9%
clear-num16.8%
inv-pow16.8%
neg-mul-116.8%
fma-define16.8%
pow216.8%
rem-cube-cbrt16.9%
associate-*l*16.9%
Applied egg-rr16.9%
unpow-116.9%
associate-/l*16.9%
unpow216.9%
*-commutative16.9%
fmm-undef16.9%
distribute-rgt-neg-in16.9%
metadata-eval16.9%
rem-cube-cbrt16.9%
associate-*r*16.9%
rem-cube-cbrt16.9%
Simplified16.9%
Taylor expanded in b around inf 82.6%
associate-*r/82.6%
*-commutative82.6%
associate-*r/82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification87.0%
(FPCore (a b c)
:precision binary64
(if (<= b -4.5e+28)
(* (/ b a) -0.6666666666666666)
(if (<= b 1.95e-95)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(/ 1.0 (* b (- (/ (* a 1.5) (pow b 2.0)) (/ 2.0 c)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e+28) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 1.95e-95) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
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 <= (-4.5d+28)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 1.95d-95) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else
tmp = 1.0d0 / (b * (((a * 1.5d0) / (b ** 2.0d0)) - (2.0d0 / c)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e+28) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 1.95e-95) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / Math.pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.5e+28: tmp = (b / a) * -0.6666666666666666 elif b <= 1.95e-95: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = 1.0 / (b * (((a * 1.5) / math.pow(b, 2.0)) - (2.0 / c))) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.5e+28) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 1.95e-95) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(1.0 / Float64(b * Float64(Float64(Float64(a * 1.5) / (b ^ 2.0)) - Float64(2.0 / c)))); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.5e+28) tmp = (b / a) * -0.6666666666666666; elseif (b <= 1.95e-95) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = 1.0 / (b * (((a * 1.5) / (b ^ 2.0)) - (2.0 / c))); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+28], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 1.95e-95], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b * N[(N[(N[(a * 1.5), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 1.95 \cdot 10^{-95}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{b \cdot \left(\frac{a \cdot 1.5}{{b}^{2}} - \frac{2}{c}\right)}\\
\end{array}
\end{array}
if b < -4.4999999999999997e28Initial program 56.9%
Simplified56.9%
Taylor expanded in b around -inf 92.9%
*-commutative92.9%
Simplified92.9%
if -4.4999999999999997e28 < b < 1.95e-95Initial program 85.7%
if 1.95e-95 < b Initial program 16.9%
add-cube-cbrt16.9%
pow316.9%
Applied egg-rr16.9%
clear-num16.8%
inv-pow16.8%
neg-mul-116.8%
fma-define16.8%
pow216.8%
rem-cube-cbrt16.9%
associate-*l*16.9%
Applied egg-rr16.9%
unpow-116.9%
associate-/l*16.9%
unpow216.9%
*-commutative16.9%
fmm-undef16.9%
distribute-rgt-neg-in16.9%
metadata-eval16.9%
rem-cube-cbrt16.9%
associate-*r*16.9%
rem-cube-cbrt16.9%
Simplified16.9%
Taylor expanded in b around inf 82.6%
associate-*r/82.6%
*-commutative82.6%
associate-*r/82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification87.0%
(FPCore (a b c)
:precision binary64
(if (<= b -4.5e+28)
(* (/ b a) -0.6666666666666666)
(if (<= b 4.8e-99)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
(/ 1.0 (* b (- (/ (* a 1.5) (pow b 2.0)) (/ 2.0 c)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e+28) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 4.8e-99) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
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 <= (-4.5d+28)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 4.8d-99) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (a * 3.0d0)
else
tmp = 1.0d0 / (b * (((a * 1.5d0) / (b ** 2.0d0)) - (2.0d0 / c)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.5e+28) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 4.8e-99) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / Math.pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.5e+28: tmp = (b / a) * -0.6666666666666666 elif b <= 4.8e-99: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0) else: tmp = 1.0 / (b * (((a * 1.5) / math.pow(b, 2.0)) - (2.0 / c))) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.5e+28) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 4.8e-99) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0)); else tmp = Float64(1.0 / Float64(b * Float64(Float64(Float64(a * 1.5) / (b ^ 2.0)) - Float64(2.0 / c)))); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.5e+28) tmp = (b / a) * -0.6666666666666666; elseif (b <= 4.8e-99) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0); else tmp = 1.0 / (b * (((a * 1.5) / (b ^ 2.0)) - (2.0 / c))); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+28], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 4.8e-99], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b * N[(N[(N[(a * 1.5), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+28}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{-99}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{b \cdot \left(\frac{a \cdot 1.5}{{b}^{2}} - \frac{2}{c}\right)}\\
\end{array}
\end{array}
if b < -4.4999999999999997e28Initial program 56.9%
Simplified56.9%
Taylor expanded in b around -inf 92.9%
*-commutative92.9%
Simplified92.9%
if -4.4999999999999997e28 < b < 4.8000000000000001e-99Initial program 85.7%
sqr-neg85.7%
sqr-neg85.7%
associate-*l*85.6%
Simplified85.6%
if 4.8000000000000001e-99 < b Initial program 16.9%
add-cube-cbrt16.9%
pow316.9%
Applied egg-rr16.9%
clear-num16.8%
inv-pow16.8%
neg-mul-116.8%
fma-define16.8%
pow216.8%
rem-cube-cbrt16.9%
associate-*l*16.9%
Applied egg-rr16.9%
unpow-116.9%
associate-/l*16.9%
unpow216.9%
*-commutative16.9%
fmm-undef16.9%
distribute-rgt-neg-in16.9%
metadata-eval16.9%
rem-cube-cbrt16.9%
associate-*r*16.9%
rem-cube-cbrt16.9%
Simplified16.9%
Taylor expanded in b around inf 82.6%
associate-*r/82.6%
*-commutative82.6%
associate-*r/82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification87.0%
(FPCore (a b c)
:precision binary64
(if (<= b -1.8e-97)
(/ (* b -2.0) (* a 3.0))
(if (<= b 6.4e-96)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(/ 1.0 (* b (- (/ (* a 1.5) (pow b 2.0)) (/ 2.0 c)))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.8e-97) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 6.4e-96) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
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 <= (-1.8d-97)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 6.4d-96) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
else
tmp = 1.0d0 / (b * (((a * 1.5d0) / (b ** 2.0d0)) - (2.0d0 / c)))
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.8e-97) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 6.4e-96) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = 1.0 / (b * (((a * 1.5) / Math.pow(b, 2.0)) - (2.0 / c)));
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.8e-97: tmp = (b * -2.0) / (a * 3.0) elif b <= 6.4e-96: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = 1.0 / (b * (((a * 1.5) / math.pow(b, 2.0)) - (2.0 / c))) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.8e-97) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 6.4e-96) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(1.0 / Float64(b * Float64(Float64(Float64(a * 1.5) / (b ^ 2.0)) - Float64(2.0 / c)))); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.8e-97) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 6.4e-96) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = 1.0 / (b * (((a * 1.5) / (b ^ 2.0)) - (2.0 / c))); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.8e-97], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.4e-96], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b * N[(N[(N[(a * 1.5), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{-97}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{-96}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{b \cdot \left(\frac{a \cdot 1.5}{{b}^{2}} - \frac{2}{c}\right)}\\
\end{array}
\end{array}
if b < -1.79999999999999999e-97Initial program 66.3%
Simplified66.3%
Taylor expanded in b around -inf 86.9%
*-commutative86.9%
Simplified86.9%
if -1.79999999999999999e-97 < b < 6.40000000000000023e-96Initial program 81.6%
Simplified81.6%
Taylor expanded in b around 0 74.1%
associate-*r*74.2%
*-commutative74.2%
Simplified74.2%
if 6.40000000000000023e-96 < b Initial program 16.9%
add-cube-cbrt16.9%
pow316.9%
Applied egg-rr16.9%
clear-num16.8%
inv-pow16.8%
neg-mul-116.8%
fma-define16.8%
pow216.8%
rem-cube-cbrt16.9%
associate-*l*16.9%
Applied egg-rr16.9%
unpow-116.9%
associate-/l*16.9%
unpow216.9%
*-commutative16.9%
fmm-undef16.9%
distribute-rgt-neg-in16.9%
metadata-eval16.9%
rem-cube-cbrt16.9%
associate-*r*16.9%
rem-cube-cbrt16.9%
Simplified16.9%
Taylor expanded in b around inf 82.6%
associate-*r/82.6%
*-commutative82.6%
associate-*r/82.6%
metadata-eval82.6%
Simplified82.6%
Final simplification82.3%
(FPCore (a b c)
:precision binary64
(if (<= b -7e-156)
(/ (* b -2.0) (* a 3.0))
(if (<= b 1.8e-245)
(* (sqrt (/ 1.0 (* -0.3333333333333333 (/ a c)))) (- -0.3333333333333333))
(if (<= b 3.5e-137)
(* -0.3333333333333333 (sqrt (* c (/ -3.0 a))))
(* -0.5 (/ c b))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7e-156) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 1.8e-245) {
tmp = sqrt((1.0 / (-0.3333333333333333 * (a / c)))) * -(-0.3333333333333333);
} else if (b <= 3.5e-137) {
tmp = -0.3333333333333333 * sqrt((c * (-3.0 / a)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-7d-156)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 1.8d-245) then
tmp = sqrt((1.0d0 / ((-0.3333333333333333d0) * (a / c)))) * -(-0.3333333333333333d0)
else if (b <= 3.5d-137) then
tmp = (-0.3333333333333333d0) * sqrt((c * ((-3.0d0) / a)))
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -7e-156) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 1.8e-245) {
tmp = Math.sqrt((1.0 / (-0.3333333333333333 * (a / c)))) * -(-0.3333333333333333);
} else if (b <= 3.5e-137) {
tmp = -0.3333333333333333 * Math.sqrt((c * (-3.0 / a)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7e-156: tmp = (b * -2.0) / (a * 3.0) elif b <= 1.8e-245: tmp = math.sqrt((1.0 / (-0.3333333333333333 * (a / c)))) * -(-0.3333333333333333) elif b <= 3.5e-137: tmp = -0.3333333333333333 * math.sqrt((c * (-3.0 / a))) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7e-156) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 1.8e-245) tmp = Float64(sqrt(Float64(1.0 / Float64(-0.3333333333333333 * Float64(a / c)))) * Float64(-(-0.3333333333333333))); elseif (b <= 3.5e-137) tmp = Float64(-0.3333333333333333 * sqrt(Float64(c * Float64(-3.0 / a)))); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -7e-156) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 1.8e-245) tmp = sqrt((1.0 / (-0.3333333333333333 * (a / c)))) * -(-0.3333333333333333); elseif (b <= 3.5e-137) tmp = -0.3333333333333333 * sqrt((c * (-3.0 / a))); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7e-156], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e-245], N[(N[Sqrt[N[(1.0 / N[(-0.3333333333333333 * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (--0.3333333333333333)), $MachinePrecision], If[LessEqual[b, 3.5e-137], N[(-0.3333333333333333 * N[Sqrt[N[(c * N[(-3.0 / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{-156}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{-245}:\\
\;\;\;\;\sqrt{\frac{1}{-0.3333333333333333 \cdot \frac{a}{c}}} \cdot \left(--0.3333333333333333\right)\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-137}:\\
\;\;\;\;-0.3333333333333333 \cdot \sqrt{c \cdot \frac{-3}{a}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -6.9999999999999999e-156Initial program 69.2%
Simplified69.3%
Taylor expanded in b around -inf 82.2%
*-commutative82.2%
Simplified82.2%
if -6.9999999999999999e-156 < b < 1.8e-245Initial program 76.9%
add-cube-cbrt76.3%
pow376.4%
Applied egg-rr76.4%
Taylor expanded in a around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt49.0%
rem-cube-cbrt49.3%
Simplified49.3%
clear-num49.3%
inv-pow49.3%
*-un-lft-identity49.3%
*-commutative49.3%
times-frac49.5%
metadata-eval49.5%
Applied egg-rr49.5%
unpow-149.5%
Simplified49.5%
if 1.8e-245 < b < 3.5000000000000001e-137Initial program 80.4%
add-cube-cbrt79.6%
pow379.6%
Applied egg-rr79.6%
Taylor expanded in a around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt24.2%
rem-cube-cbrt24.4%
Simplified24.4%
mul-1-neg24.4%
distribute-rgt-neg-out24.4%
add-sqr-sqrt24.4%
sqr-neg24.4%
mul-1-neg24.4%
mul-1-neg24.4%
sqrt-unprod0.2%
add-sqr-sqrt57.5%
associate-*r*57.5%
metadata-eval57.5%
associate-/l*57.6%
Applied egg-rr57.6%
distribute-lft-neg-in57.6%
metadata-eval57.6%
Simplified57.6%
if 3.5000000000000001e-137 < b Initial program 20.5%
Simplified20.5%
Taylor expanded in b around inf 79.1%
Final simplification76.0%
(FPCore (a b c)
:precision binary64
(if (<= b -1.3e-158)
(/ (* b -2.0) (* a 3.0))
(if (<= b 7.1e-246)
(* (sqrt (/ (* c -3.0) a)) (- -0.3333333333333333))
(if (<= b 5e-139)
(* -0.3333333333333333 (sqrt (* c (/ -3.0 a))))
(* -0.5 (/ c b))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.3e-158) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 7.1e-246) {
tmp = sqrt(((c * -3.0) / a)) * -(-0.3333333333333333);
} else if (b <= 5e-139) {
tmp = -0.3333333333333333 * sqrt((c * (-3.0 / a)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-1.3d-158)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 7.1d-246) then
tmp = sqrt(((c * (-3.0d0)) / a)) * -(-0.3333333333333333d0)
else if (b <= 5d-139) then
tmp = (-0.3333333333333333d0) * sqrt((c * ((-3.0d0) / a)))
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.3e-158) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 7.1e-246) {
tmp = Math.sqrt(((c * -3.0) / a)) * -(-0.3333333333333333);
} else if (b <= 5e-139) {
tmp = -0.3333333333333333 * Math.sqrt((c * (-3.0 / a)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.3e-158: tmp = (b * -2.0) / (a * 3.0) elif b <= 7.1e-246: tmp = math.sqrt(((c * -3.0) / a)) * -(-0.3333333333333333) elif b <= 5e-139: tmp = -0.3333333333333333 * math.sqrt((c * (-3.0 / a))) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.3e-158) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 7.1e-246) tmp = Float64(sqrt(Float64(Float64(c * -3.0) / a)) * Float64(-(-0.3333333333333333))); elseif (b <= 5e-139) tmp = Float64(-0.3333333333333333 * sqrt(Float64(c * Float64(-3.0 / a)))); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.3e-158) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 7.1e-246) tmp = sqrt(((c * -3.0) / a)) * -(-0.3333333333333333); elseif (b <= 5e-139) tmp = -0.3333333333333333 * sqrt((c * (-3.0 / a))); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.3e-158], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.1e-246], N[(N[Sqrt[N[(N[(c * -3.0), $MachinePrecision] / a), $MachinePrecision]], $MachinePrecision] * (--0.3333333333333333)), $MachinePrecision], If[LessEqual[b, 5e-139], N[(-0.3333333333333333 * N[Sqrt[N[(c * N[(-3.0 / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{-158}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 7.1 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{\frac{c \cdot -3}{a}} \cdot \left(--0.3333333333333333\right)\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-139}:\\
\;\;\;\;-0.3333333333333333 \cdot \sqrt{c \cdot \frac{-3}{a}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -1.3e-158Initial program 69.2%
Simplified69.3%
Taylor expanded in b around -inf 82.2%
*-commutative82.2%
Simplified82.2%
if -1.3e-158 < b < 7.10000000000000036e-246Initial program 76.9%
add-cube-cbrt76.3%
pow376.4%
Applied egg-rr76.4%
Taylor expanded in a around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt49.0%
rem-cube-cbrt49.3%
Simplified49.3%
if 7.10000000000000036e-246 < b < 5.00000000000000034e-139Initial program 80.4%
add-cube-cbrt79.6%
pow379.6%
Applied egg-rr79.6%
Taylor expanded in a around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt24.2%
rem-cube-cbrt24.4%
Simplified24.4%
mul-1-neg24.4%
distribute-rgt-neg-out24.4%
add-sqr-sqrt24.4%
sqr-neg24.4%
mul-1-neg24.4%
mul-1-neg24.4%
sqrt-unprod0.2%
add-sqr-sqrt57.5%
associate-*r*57.5%
metadata-eval57.5%
associate-/l*57.6%
Applied egg-rr57.6%
distribute-lft-neg-in57.6%
metadata-eval57.6%
Simplified57.6%
if 5.00000000000000034e-139 < b Initial program 20.5%
Simplified20.5%
Taylor expanded in b around inf 79.1%
Final simplification76.0%
(FPCore (a b c)
:precision binary64
(if (<= b -6.8e-156)
(/ (* b -2.0) (* a 3.0))
(if (<= b 5.4e-269)
(sqrt (* c (* (/ -3.0 a) 0.1111111111111111)))
(if (<= b 8.2e-147)
(* -0.3333333333333333 (sqrt (* c (/ -3.0 a))))
(* -0.5 (/ c b))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6.8e-156) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 5.4e-269) {
tmp = sqrt((c * ((-3.0 / a) * 0.1111111111111111)));
} else if (b <= 8.2e-147) {
tmp = -0.3333333333333333 * sqrt((c * (-3.0 / a)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-6.8d-156)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 5.4d-269) then
tmp = sqrt((c * (((-3.0d0) / a) * 0.1111111111111111d0)))
else if (b <= 8.2d-147) then
tmp = (-0.3333333333333333d0) * sqrt((c * ((-3.0d0) / a)))
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -6.8e-156) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 5.4e-269) {
tmp = Math.sqrt((c * ((-3.0 / a) * 0.1111111111111111)));
} else if (b <= 8.2e-147) {
tmp = -0.3333333333333333 * Math.sqrt((c * (-3.0 / a)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6.8e-156: tmp = (b * -2.0) / (a * 3.0) elif b <= 5.4e-269: tmp = math.sqrt((c * ((-3.0 / a) * 0.1111111111111111))) elif b <= 8.2e-147: tmp = -0.3333333333333333 * math.sqrt((c * (-3.0 / a))) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6.8e-156) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 5.4e-269) tmp = sqrt(Float64(c * Float64(Float64(-3.0 / a) * 0.1111111111111111))); elseif (b <= 8.2e-147) tmp = Float64(-0.3333333333333333 * sqrt(Float64(c * Float64(-3.0 / a)))); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -6.8e-156) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 5.4e-269) tmp = sqrt((c * ((-3.0 / a) * 0.1111111111111111))); elseif (b <= 8.2e-147) tmp = -0.3333333333333333 * sqrt((c * (-3.0 / a))); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6.8e-156], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.4e-269], N[Sqrt[N[(c * N[(N[(-3.0 / a), $MachinePrecision] * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[b, 8.2e-147], N[(-0.3333333333333333 * N[Sqrt[N[(c * N[(-3.0 / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.8 \cdot 10^{-156}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{-269}:\\
\;\;\;\;\sqrt{c \cdot \left(\frac{-3}{a} \cdot 0.1111111111111111\right)}\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-147}:\\
\;\;\;\;-0.3333333333333333 \cdot \sqrt{c \cdot \frac{-3}{a}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -6.79999999999999981e-156Initial program 69.2%
Simplified69.3%
Taylor expanded in b around -inf 82.2%
*-commutative82.2%
Simplified82.2%
if -6.79999999999999981e-156 < b < 5.40000000000000031e-269Initial program 74.9%
add-cube-cbrt74.4%
pow374.4%
Applied egg-rr74.4%
Taylor expanded in a around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt48.8%
rem-cube-cbrt49.2%
Simplified49.2%
add-sqr-sqrt49.0%
sqrt-unprod49.2%
*-commutative49.2%
*-commutative49.2%
swap-sqr49.1%
mul-1-neg49.1%
mul-1-neg49.1%
sqr-neg49.1%
add-sqr-sqrt49.3%
associate-/l*49.2%
metadata-eval49.2%
Applied egg-rr49.2%
associate-*l*49.2%
Simplified49.2%
if 5.40000000000000031e-269 < b < 8.1999999999999999e-147Initial program 82.2%
add-cube-cbrt81.2%
pow381.4%
Applied egg-rr81.4%
Taylor expanded in a around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt26.5%
rem-cube-cbrt26.8%
Simplified26.8%
mul-1-neg26.8%
distribute-rgt-neg-out26.8%
add-sqr-sqrt26.8%
sqr-neg26.8%
mul-1-neg26.8%
mul-1-neg26.8%
sqrt-unprod0.2%
add-sqr-sqrt56.8%
associate-*r*56.8%
metadata-eval56.8%
associate-/l*56.9%
Applied egg-rr56.9%
distribute-lft-neg-in56.9%
metadata-eval56.9%
Simplified56.9%
if 8.1999999999999999e-147 < b Initial program 20.5%
Simplified20.5%
Taylor expanded in b around inf 79.1%
Final simplification76.0%
(FPCore (a b c)
:precision binary64
(if (<= b -1.9e-97)
(/ (* b -2.0) (* a 3.0))
(if (<= b 2.55e-95)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-97) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 2.55e-95) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-1.9d-97)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 2.55d-95) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-97) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 2.55e-95) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.9e-97: tmp = (b * -2.0) / (a * 3.0) elif b <= 2.55e-95: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.9e-97) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 2.55e-95) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.9e-97) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 2.55e-95) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.9e-97], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.55e-95], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-97}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2.55 \cdot 10^{-95}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -1.9e-97Initial program 66.3%
Simplified66.3%
Taylor expanded in b around -inf 86.9%
*-commutative86.9%
Simplified86.9%
if -1.9e-97 < b < 2.55e-95Initial program 81.6%
Simplified81.6%
Taylor expanded in b around 0 74.1%
associate-*r*74.2%
*-commutative74.2%
Simplified74.2%
if 2.55e-95 < b Initial program 16.9%
Simplified16.9%
Taylor expanded in b around inf 82.4%
Final simplification82.2%
(FPCore (a b c)
:precision binary64
(if (<= b -7.2e-98)
(/ (* b -2.0) (* a 3.0))
(if (<= b 4.3e-95)
(/ (- (sqrt (* -3.0 (* a c))) b) (* a 3.0))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7.2e-98) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 4.3e-95) {
tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-7.2d-98)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 4.3d-95) then
tmp = (sqrt(((-3.0d0) * (a * c))) - b) / (a * 3.0d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -7.2e-98) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 4.3e-95) {
tmp = (Math.sqrt((-3.0 * (a * c))) - b) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7.2e-98: tmp = (b * -2.0) / (a * 3.0) elif b <= 4.3e-95: tmp = (math.sqrt((-3.0 * (a * c))) - b) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7.2e-98) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 4.3e-95) tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(a * c))) - b) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -7.2e-98) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 4.3e-95) tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7.2e-98], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.3e-95], N[(N[(N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{-98}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{-95}:\\
\;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -7.2000000000000005e-98Initial program 66.3%
Simplified66.3%
Taylor expanded in b around -inf 86.9%
*-commutative86.9%
Simplified86.9%
if -7.2000000000000005e-98 < b < 4.29999999999999997e-95Initial program 81.6%
Simplified81.6%
Taylor expanded in b around 0 74.1%
if 4.29999999999999997e-95 < b Initial program 16.9%
Simplified16.9%
Taylor expanded in b around inf 82.4%
Final simplification82.2%
(FPCore (a b c)
:precision binary64
(if (<= b -7.6e-110)
(/ (* b -2.0) (* a 3.0))
(if (<= b 1.2e-95)
(* 0.3333333333333333 (/ (+ b (sqrt (* c (* a -3.0)))) a))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7.6e-110) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 1.2e-95) {
tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -3.0)))) / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-7.6d-110)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 1.2d-95) then
tmp = 0.3333333333333333d0 * ((b + sqrt((c * (a * (-3.0d0))))) / a)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -7.6e-110) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 1.2e-95) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((c * (a * -3.0)))) / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7.6e-110: tmp = (b * -2.0) / (a * 3.0) elif b <= 1.2e-95: tmp = 0.3333333333333333 * ((b + math.sqrt((c * (a * -3.0)))) / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7.6e-110) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 1.2e-95) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(c * Float64(a * -3.0)))) / a)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -7.6e-110) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 1.2e-95) tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -3.0)))) / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7.6e-110], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.2e-95], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.6 \cdot 10^{-110}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{-95}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -7.5999999999999996e-110Initial program 66.9%
Simplified66.9%
Taylor expanded in b around -inf 86.3%
*-commutative86.3%
Simplified86.3%
if -7.5999999999999996e-110 < b < 1.2e-95Initial program 81.1%
Simplified81.1%
Taylor expanded in b around 0 74.5%
*-un-lft-identity74.5%
times-frac74.6%
metadata-eval74.6%
sub-neg74.6%
metadata-eval74.6%
distribute-lft-neg-in74.6%
associate-*r*74.6%
*-commutative74.6%
distribute-rgt-neg-in74.6%
*-commutative74.6%
distribute-rgt-neg-in74.6%
metadata-eval74.6%
add-sqr-sqrt34.1%
sqrt-unprod74.2%
sqr-neg74.2%
sqrt-prod40.4%
add-sqr-sqrt72.7%
Applied egg-rr72.7%
if 1.2e-95 < b Initial program 16.9%
Simplified16.9%
Taylor expanded in b around inf 82.4%
Final simplification81.7%
(FPCore (a b c)
:precision binary64
(if (<= b -4.4e-107)
(/ (* b -2.0) (* a 3.0))
(if (<= b 1.68e-96)
(/ (sqrt (* a (* c -3.0))) (* a 3.0))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e-107) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 1.68e-96) {
tmp = sqrt((a * (c * -3.0))) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-4.4d-107)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 1.68d-96) then
tmp = sqrt((a * (c * (-3.0d0)))) / (a * 3.0d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e-107) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 1.68e-96) {
tmp = Math.sqrt((a * (c * -3.0))) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.4e-107: tmp = (b * -2.0) / (a * 3.0) elif b <= 1.68e-96: tmp = math.sqrt((a * (c * -3.0))) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.4e-107) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 1.68e-96) tmp = Float64(sqrt(Float64(a * Float64(c * -3.0))) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.4e-107) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 1.68e-96) tmp = sqrt((a * (c * -3.0))) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.4e-107], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.68e-96], N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{-107}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.68 \cdot 10^{-96}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.40000000000000025e-107Initial program 66.9%
Simplified66.9%
Taylor expanded in b around -inf 86.3%
*-commutative86.3%
Simplified86.3%
if -4.40000000000000025e-107 < b < 1.6800000000000001e-96Initial program 81.1%
add-cube-cbrt80.4%
pow380.5%
Applied egg-rr80.5%
Taylor expanded in a around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt72.6%
distribute-lft-neg-in72.6%
metadata-eval72.6%
rem-cube-cbrt73.0%
Simplified73.0%
if 1.6800000000000001e-96 < b Initial program 16.9%
Simplified16.9%
Taylor expanded in b around inf 82.4%
Final simplification81.8%
(FPCore (a b c)
:precision binary64
(if (<= b -5.5e-159)
(/ (* b -2.0) (* a 3.0))
(if (<= b 2.7e-179)
(sqrt (* c (* (/ -3.0 a) 0.1111111111111111)))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-159) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 2.7e-179) {
tmp = sqrt((c * ((-3.0 / a) * 0.1111111111111111)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-5.5d-159)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else if (b <= 2.7d-179) then
tmp = sqrt((c * (((-3.0d0) / a) * 0.1111111111111111d0)))
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-159) {
tmp = (b * -2.0) / (a * 3.0);
} else if (b <= 2.7e-179) {
tmp = Math.sqrt((c * ((-3.0 / a) * 0.1111111111111111)));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.5e-159: tmp = (b * -2.0) / (a * 3.0) elif b <= 2.7e-179: tmp = math.sqrt((c * ((-3.0 / a) * 0.1111111111111111))) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.5e-159) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); elseif (b <= 2.7e-179) tmp = sqrt(Float64(c * Float64(Float64(-3.0 / a) * 0.1111111111111111))); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.5e-159) tmp = (b * -2.0) / (a * 3.0); elseif (b <= 2.7e-179) tmp = sqrt((c * ((-3.0 / a) * 0.1111111111111111))); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.5e-159], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.7e-179], N[Sqrt[N[(c * N[(N[(-3.0 / a), $MachinePrecision] * 0.1111111111111111), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-159}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{-179}:\\
\;\;\;\;\sqrt{c \cdot \left(\frac{-3}{a} \cdot 0.1111111111111111\right)}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -5.5000000000000003e-159Initial program 69.2%
Simplified69.3%
Taylor expanded in b around -inf 82.2%
*-commutative82.2%
Simplified82.2%
if -5.5000000000000003e-159 < b < 2.69999999999999988e-179Initial program 76.4%
add-cube-cbrt75.7%
pow375.8%
Applied egg-rr75.8%
Taylor expanded in a around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt45.9%
rem-cube-cbrt46.2%
Simplified46.2%
add-sqr-sqrt46.1%
sqrt-unprod46.1%
*-commutative46.1%
*-commutative46.1%
swap-sqr46.0%
mul-1-neg46.0%
mul-1-neg46.0%
sqr-neg46.0%
add-sqr-sqrt46.2%
associate-/l*46.0%
metadata-eval46.0%
Applied egg-rr46.0%
associate-*l*46.0%
Simplified46.0%
if 2.69999999999999988e-179 < b Initial program 26.0%
Simplified26.0%
Taylor expanded in b around inf 74.1%
Final simplification73.9%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (/ (* b -2.0) (* a 3.0)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (b * -2.0) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-1d-310)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (b * -2.0) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = (b * -2.0) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1e-310) tmp = (b * -2.0) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 70.5%
Simplified70.5%
Taylor expanded in b around -inf 72.9%
*-commutative72.9%
Simplified72.9%
if -9.999999999999969e-311 < b Initial program 33.9%
Simplified33.9%
Taylor expanded in b around inf 62.6%
Final simplification68.2%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (* (* b -2.0) (/ 0.3333333333333333 a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (b * -2.0) * (0.3333333333333333 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-1d-310)) then
tmp = (b * (-2.0d0)) * (0.3333333333333333d0 / a)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (b * -2.0) * (0.3333333333333333 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = (b * -2.0) * (0.3333333333333333 / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(Float64(b * -2.0) * Float64(0.3333333333333333 / a)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1e-310) tmp = (b * -2.0) * (0.3333333333333333 / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(b * -2.0), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\left(b \cdot -2\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 70.5%
add-cube-cbrt70.4%
pow370.4%
Applied egg-rr70.4%
div-inv70.3%
neg-mul-170.3%
fma-define70.3%
pow270.3%
rem-cube-cbrt70.4%
associate-*l*70.4%
Applied egg-rr70.4%
associate-/r*70.4%
metadata-eval70.4%
metadata-eval70.4%
associate-*r/70.4%
*-commutative70.4%
associate-*r/70.4%
metadata-eval70.4%
unpow270.4%
*-commutative70.4%
fmm-undef70.4%
distribute-rgt-neg-in70.4%
metadata-eval70.4%
rem-cube-cbrt70.3%
associate-*r*70.3%
rem-cube-cbrt70.5%
Simplified70.5%
Taylor expanded in b around -inf 72.9%
*-commutative72.9%
Simplified72.9%
if -9.999999999999969e-311 < b Initial program 33.9%
Simplified33.9%
Taylor expanded in b around inf 62.6%
Final simplification68.2%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (* (/ b a) -0.6666666666666666) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
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 <= (-1d-310)) then
tmp = (b / a) * (-0.6666666666666666d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = (b / a) * -0.6666666666666666 else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1e-310) tmp = (b / a) * -0.6666666666666666; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 70.5%
Simplified70.5%
Taylor expanded in b around -inf 72.8%
*-commutative72.8%
Simplified72.8%
if -9.999999999999969e-311 < b Initial program 33.9%
Simplified33.9%
Taylor expanded in b around inf 62.6%
(FPCore (a b c) :precision binary64 (* -0.5 (/ c b)))
double code(double a, double b, double c) {
return -0.5 * (c / b);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-0.5d0) * (c / b)
end function
public static double code(double a, double b, double c) {
return -0.5 * (c / b);
}
def code(a, b, c): return -0.5 * (c / b)
function code(a, b, c) return Float64(-0.5 * Float64(c / b)) end
function tmp = code(a, b, c) tmp = -0.5 * (c / b); end
code[a_, b_, c_] := N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.5 \cdot \frac{c}{b}
\end{array}
Initial program 53.9%
Simplified53.9%
Taylor expanded in b around inf 29.6%
(FPCore (a b c) :precision binary64 (/ 0.0 a))
double code(double a, double b, double c) {
return 0.0 / a;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.0d0 / a
end function
public static double code(double a, double b, double c) {
return 0.0 / a;
}
def code(a, b, c): return 0.0 / a
function code(a, b, c) return Float64(0.0 / a) end
function tmp = code(a, b, c) tmp = 0.0 / a; end
code[a_, b_, c_] := N[(0.0 / a), $MachinePrecision]
\begin{array}{l}
\\
\frac{0}{a}
\end{array}
Initial program 53.9%
add-cube-cbrt53.7%
pow353.7%
Applied egg-rr53.7%
div-inv53.7%
neg-mul-153.7%
fma-define53.7%
pow253.7%
rem-cube-cbrt53.9%
associate-*l*53.9%
Applied egg-rr53.9%
associate-/r*53.9%
metadata-eval53.9%
metadata-eval53.9%
associate-*r/53.8%
*-commutative53.8%
associate-*r/53.9%
metadata-eval53.9%
unpow253.9%
*-commutative53.9%
fmm-undef53.8%
distribute-rgt-neg-in53.8%
metadata-eval53.8%
rem-cube-cbrt53.7%
associate-*r*53.7%
rem-cube-cbrt53.9%
Simplified53.9%
Taylor expanded in a around 0 8.6%
associate-*r/8.6%
distribute-rgt1-in8.6%
metadata-eval8.6%
mul0-lft8.6%
metadata-eval8.6%
Simplified8.6%
herbie shell --seed 2024152
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))