
(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 13 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 -9e+105)
(/ b (* a -1.5))
(if (<= b 7.4e-174)
(* (- b (sqrt (fma b b (* a (* -3.0 c))))) (/ -0.3333333333333333 a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9e+105) {
tmp = b / (a * -1.5);
} else if (b <= 7.4e-174) {
tmp = (b - sqrt(fma(b, b, (a * (-3.0 * c))))) * (-0.3333333333333333 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -9e+105) tmp = Float64(b / Float64(a * -1.5)); elseif (b <= 7.4e-174) tmp = Float64(Float64(b - sqrt(fma(b, b, Float64(a * Float64(-3.0 * c))))) * Float64(-0.3333333333333333 / a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -9e+105], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(b - N[Sqrt[N[(b * b + N[(a * N[(-3.0 * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{+105}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\
\;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(-3 \cdot c\right)\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -9.0000000000000002e105Initial program 47.8%
sqr-neg47.8%
sqr-neg47.8%
associate-*l*47.8%
Simplified47.8%
Taylor expanded in b around -inf 96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in b around 0 96.1%
*-commutative96.1%
associate-*l/96.1%
associate-/l*96.0%
Simplified96.0%
clear-num95.9%
un-div-inv96.0%
div-inv96.2%
metadata-eval96.2%
Applied egg-rr96.2%
if -9.0000000000000002e105 < b < 7.40000000000000019e-174Initial program 84.1%
sqr-neg84.1%
sqr-neg84.1%
associate-*l*84.0%
Simplified84.0%
frac-2neg84.0%
div-inv84.0%
Applied egg-rr83.9%
Taylor expanded in a around 0 84.6%
if 7.40000000000000019e-174 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in b around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification85.5%
(FPCore (a b c)
:precision binary64
(if (<= b -8.8e+144)
(* (/ b a) -0.6666666666666666)
(if (<= b 7.4e-174)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.8e+144) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 7.4e-174) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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 <= (-8.8d+144)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 7.4d-174) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.8e+144) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 7.4e-174) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.8e+144: tmp = (b / a) * -0.6666666666666666 elif b <= 7.4e-174: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.8e+144) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 7.4e-174) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -8.8e+144) tmp = (b / a) * -0.6666666666666666; elseif (b <= 7.4e-174) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.8e+144], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 7.4e-174], 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[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+144}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.79999999999999952e144Initial program 39.5%
sqr-neg39.5%
sqr-neg39.5%
associate-*l*39.5%
Simplified39.5%
Taylor expanded in b around -inf 95.6%
*-commutative95.6%
Simplified95.6%
if -8.79999999999999952e144 < b < 7.40000000000000019e-174Initial program 85.0%
if 7.40000000000000019e-174 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in b around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -1.05e+145)
(* (/ b a) -0.6666666666666666)
(if (<= b 7.4e-174)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.05e+145) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 7.4e-174) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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.05d+145)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 7.4d-174) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.05e+145) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 7.4e-174) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.05e+145: tmp = (b / a) * -0.6666666666666666 elif b <= 7.4e-174: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.05e+145) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 7.4e-174) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.05e+145) tmp = (b / a) * -0.6666666666666666; elseif (b <= 7.4e-174) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.05e+145], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 7.4e-174], 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[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.05 \cdot 10^{+145}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -1.04999999999999995e145Initial program 39.5%
sqr-neg39.5%
sqr-neg39.5%
associate-*l*39.5%
Simplified39.5%
Taylor expanded in b around -inf 95.6%
*-commutative95.6%
Simplified95.6%
if -1.04999999999999995e145 < b < 7.40000000000000019e-174Initial program 85.0%
sqr-neg85.0%
sqr-neg85.0%
associate-*l*85.0%
Simplified85.0%
if 7.40000000000000019e-174 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in b around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -5.5e-70)
(+ (/ (* b -0.6666666666666666) a) (* (/ c b) 0.5))
(if (<= b 7.4e-174)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-70) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else if (b <= 7.4e-174) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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-70)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + ((c / b) * 0.5d0)
else if (b <= 7.4d-174) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5.5e-70) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else if (b <= 7.4e-174) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.5e-70: tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5) elif b <= 7.4e-174: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.5e-70) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c / b) * 0.5)); elseif (b <= 7.4e-174) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.5e-70) tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5); elseif (b <= 7.4e-174) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.5e-70], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-70}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -5.5000000000000001e-70Initial program 69.2%
sqr-neg69.2%
sqr-neg69.2%
associate-*l*69.2%
Simplified69.2%
Taylor expanded in b around -inf 85.1%
Taylor expanded in c around 0 85.2%
associate-*r/85.2%
Applied egg-rr85.2%
if -5.5000000000000001e-70 < b < 7.40000000000000019e-174Initial program 76.6%
sqr-neg76.6%
sqr-neg76.6%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in b around 0 67.1%
*-commutative67.1%
associate-*l*67.0%
*-commutative67.0%
*-commutative67.0%
Simplified67.0%
+-commutative67.0%
unsub-neg67.0%
*-commutative67.0%
*-commutative67.0%
associate-*l*67.1%
Applied egg-rr67.1%
*-commutative67.1%
associate-*r*67.1%
*-commutative67.1%
Simplified67.1%
if 7.40000000000000019e-174 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in b around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification78.7%
(FPCore (a b c)
:precision binary64
(if (<= b -7.2e-70)
(+ (/ (* b -0.6666666666666666) a) (* (/ c b) 0.5))
(if (<= b 7.4e-174)
(* (/ -0.3333333333333333 a) (- b (sqrt (* c (* a -3.0)))))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -7.2e-70) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else if (b <= 7.4e-174) {
tmp = (-0.3333333333333333 / a) * (b - sqrt((c * (a * -3.0))));
} else {
tmp = (c / b) * -0.5;
}
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-70)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + ((c / b) * 0.5d0)
else if (b <= 7.4d-174) then
tmp = ((-0.3333333333333333d0) / a) * (b - sqrt((c * (a * (-3.0d0)))))
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -7.2e-70) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else if (b <= 7.4e-174) {
tmp = (-0.3333333333333333 / a) * (b - Math.sqrt((c * (a * -3.0))));
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -7.2e-70: tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5) elif b <= 7.4e-174: tmp = (-0.3333333333333333 / a) * (b - math.sqrt((c * (a * -3.0)))) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -7.2e-70) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c / b) * 0.5)); elseif (b <= 7.4e-174) tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b - sqrt(Float64(c * Float64(a * -3.0))))); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -7.2e-70) tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5); elseif (b <= 7.4e-174) tmp = (-0.3333333333333333 / a) * (b - sqrt((c * (a * -3.0)))); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -7.2e-70], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{-70}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -7.2000000000000004e-70Initial program 69.2%
sqr-neg69.2%
sqr-neg69.2%
associate-*l*69.2%
Simplified69.2%
Taylor expanded in b around -inf 85.1%
Taylor expanded in c around 0 85.2%
associate-*r/85.2%
Applied egg-rr85.2%
if -7.2000000000000004e-70 < b < 7.40000000000000019e-174Initial program 76.6%
sqr-neg76.6%
sqr-neg76.6%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in b around 0 67.1%
*-commutative67.1%
associate-*l*67.0%
*-commutative67.0%
*-commutative67.0%
Simplified67.0%
frac-2neg67.0%
div-inv66.9%
distribute-neg-in66.9%
add-sqr-sqrt49.0%
sqrt-unprod66.6%
sqr-neg66.6%
sqrt-unprod18.0%
add-sqr-sqrt64.8%
sub-neg64.8%
add-sqr-sqrt46.8%
sqrt-unprod64.7%
sqr-neg64.7%
sqrt-unprod17.8%
add-sqr-sqrt66.9%
*-commutative66.9%
*-commutative66.9%
associate-*l*67.0%
distribute-lft-neg-in67.0%
metadata-eval67.0%
*-commutative67.0%
metadata-eval67.0%
Applied egg-rr68.2%
*-commutative68.2%
*-commutative68.2%
associate-*r*66.8%
*-commutative66.8%
Simplified66.8%
if 7.40000000000000019e-174 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in b around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification78.6%
(FPCore (a b c)
:precision binary64
(if (<= b -9e-70)
(+ (/ (* b -0.6666666666666666) a) (* (/ c b) 0.5))
(if (<= b 7.4e-174)
(* 0.3333333333333333 (/ (+ b (sqrt (* -3.0 (* a c)))) a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9e-70) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else if (b <= 7.4e-174) {
tmp = 0.3333333333333333 * ((b + sqrt((-3.0 * (a * c)))) / a);
} else {
tmp = (c / b) * -0.5;
}
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 <= (-9d-70)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + ((c / b) * 0.5d0)
else if (b <= 7.4d-174) then
tmp = 0.3333333333333333d0 * ((b + sqrt(((-3.0d0) * (a * c)))) / a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -9e-70) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else if (b <= 7.4e-174) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((-3.0 * (a * c)))) / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -9e-70: tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5) elif b <= 7.4e-174: tmp = 0.3333333333333333 * ((b + math.sqrt((-3.0 * (a * c)))) / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -9e-70) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c / b) * 0.5)); elseif (b <= 7.4e-174) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(-3.0 * Float64(a * c)))) / a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -9e-70) tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5); elseif (b <= 7.4e-174) tmp = 0.3333333333333333 * ((b + sqrt((-3.0 * (a * c)))) / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -9e-70], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{-70}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -9.00000000000000044e-70Initial program 69.2%
sqr-neg69.2%
sqr-neg69.2%
associate-*l*69.2%
Simplified69.2%
Taylor expanded in b around -inf 85.1%
Taylor expanded in c around 0 85.2%
associate-*r/85.2%
Applied egg-rr85.2%
if -9.00000000000000044e-70 < b < 7.40000000000000019e-174Initial program 76.6%
sqr-neg76.6%
sqr-neg76.6%
associate-*l*76.6%
Simplified76.6%
Taylor expanded in b around 0 67.1%
*-commutative67.1%
associate-*l*67.0%
*-commutative67.0%
*-commutative67.0%
Simplified67.0%
*-un-lft-identity67.0%
times-frac68.3%
metadata-eval68.3%
add-sqr-sqrt50.4%
sqrt-unprod68.0%
sqr-neg68.0%
sqrt-unprod18.0%
add-sqr-sqrt66.1%
*-commutative66.1%
*-commutative66.1%
associate-*l*66.1%
Applied egg-rr66.1%
if 7.40000000000000019e-174 < b Initial program 22.2%
sqr-neg22.2%
sqr-neg22.2%
associate-*l*22.2%
Simplified22.2%
Taylor expanded in b around inf 80.9%
*-commutative80.9%
Simplified80.9%
Final simplification78.4%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (+ (/ (* b -0.6666666666666666) a) (* (/ c b) 0.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else {
tmp = (c / b) * -0.5;
}
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 <= (-4d-310)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + ((c / b) * 0.5d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c / b) * 0.5)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 72.4%
sqr-neg72.4%
sqr-neg72.4%
associate-*l*72.4%
Simplified72.4%
Taylor expanded in b around -inf 60.3%
Taylor expanded in c around 0 60.8%
associate-*r/60.8%
Applied egg-rr60.8%
if -3.999999999999988e-310 < b Initial program 29.8%
sqr-neg29.8%
sqr-neg29.8%
associate-*l*29.7%
Simplified29.7%
Taylor expanded in b around inf 69.6%
*-commutative69.6%
Simplified69.6%
Final simplification64.7%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (+ (* (/ b a) -0.6666666666666666) (* (/ c b) 0.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = ((b / a) * -0.6666666666666666) + ((c / b) * 0.5);
} else {
tmp = (c / b) * -0.5;
}
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 <= (-4d-310)) then
tmp = ((b / a) * (-0.6666666666666666d0)) + ((c / b) * 0.5d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = ((b / a) * -0.6666666666666666) + ((c / b) * 0.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = ((b / a) * -0.6666666666666666) + ((c / b) * 0.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(Float64(Float64(b / a) * -0.6666666666666666) + Float64(Float64(c / b) * 0.5)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = ((b / a) * -0.6666666666666666) + ((c / b) * 0.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666 + \frac{c}{b} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 72.4%
sqr-neg72.4%
sqr-neg72.4%
associate-*l*72.4%
Simplified72.4%
Taylor expanded in b around -inf 60.3%
Taylor expanded in c around 0 60.8%
if -3.999999999999988e-310 < b Initial program 29.8%
sqr-neg29.8%
sqr-neg29.8%
associate-*l*29.7%
Simplified29.7%
Taylor expanded in b around inf 69.6%
*-commutative69.6%
Simplified69.6%
Final simplification64.7%
(FPCore (a b c) :precision binary64 (if (<= b 3.5e-308) (/ b (* a -1.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
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 <= 3.5d-308) then
tmp = b / (a * (-1.5d0))
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.5e-308: tmp = b / (a * -1.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.5e-308) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.5e-308) tmp = b / (a * -1.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-308], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-308}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 3.5e-308Initial program 72.6%
sqr-neg72.6%
sqr-neg72.6%
associate-*l*72.6%
Simplified72.6%
Taylor expanded in b around -inf 59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in b around 0 59.8%
*-commutative59.8%
associate-*l/59.8%
associate-/l*59.7%
Simplified59.7%
clear-num59.7%
un-div-inv59.7%
div-inv59.8%
metadata-eval59.8%
Applied egg-rr59.8%
if 3.5e-308 < b Initial program 29.1%
sqr-neg29.1%
sqr-neg29.1%
associate-*l*29.1%
Simplified29.1%
Taylor expanded in b around inf 70.2%
*-commutative70.2%
Simplified70.2%
(FPCore (a b c) :precision binary64 (if (<= b 3.5e-308) (* (/ b a) -0.6666666666666666) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = (c / b) * -0.5;
}
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 <= 3.5d-308) then
tmp = (b / a) * (-0.6666666666666666d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.5e-308: tmp = (b / a) * -0.6666666666666666 else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.5e-308) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.5e-308) tmp = (b / a) * -0.6666666666666666; else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-308], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-308}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 3.5e-308Initial program 72.6%
sqr-neg72.6%
sqr-neg72.6%
associate-*l*72.6%
Simplified72.6%
Taylor expanded in b around -inf 59.8%
*-commutative59.8%
Simplified59.8%
if 3.5e-308 < b Initial program 29.1%
sqr-neg29.1%
sqr-neg29.1%
associate-*l*29.1%
Simplified29.1%
Taylor expanded in b around inf 70.2%
*-commutative70.2%
Simplified70.2%
(FPCore (a b c) :precision binary64 (if (<= b 3.5e-308) (* (/ b a) -0.6666666666666666) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / 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 <= 3.5d-308) then
tmp = (b / a) * (-0.6666666666666666d0)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.5e-308: tmp = (b / a) * -0.6666666666666666 else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.5e-308) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.5e-308) tmp = (b / a) * -0.6666666666666666; else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-308], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-308}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 3.5e-308Initial program 72.6%
sqr-neg72.6%
sqr-neg72.6%
associate-*l*72.6%
Simplified72.6%
Taylor expanded in b around -inf 59.8%
*-commutative59.8%
Simplified59.8%
if 3.5e-308 < b Initial program 29.1%
sqr-neg29.1%
sqr-neg29.1%
associate-*l*29.1%
Simplified29.1%
Taylor expanded in b around inf 70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in c around 0 70.2%
associate-*r/70.2%
*-commutative70.2%
associate-*r/70.1%
Simplified70.1%
(FPCore (a b c) :precision binary64 (if (<= b 3.5e-308) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / 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 <= 3.5d-308) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3.5e-308) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.5e-308: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.5e-308) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3.5e-308) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-308], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-308}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 3.5e-308Initial program 72.6%
sqr-neg72.6%
sqr-neg72.6%
associate-*l*72.6%
Simplified72.6%
Taylor expanded in b around -inf 59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in b around 0 59.8%
*-commutative59.8%
associate-*l/59.8%
associate-/l*59.7%
Simplified59.7%
if 3.5e-308 < b Initial program 29.1%
sqr-neg29.1%
sqr-neg29.1%
associate-*l*29.1%
Simplified29.1%
Taylor expanded in b around inf 70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in c around 0 70.2%
associate-*r/70.2%
*-commutative70.2%
associate-*r/70.1%
Simplified70.1%
(FPCore (a b c) :precision binary64 (* b (/ -0.6666666666666666 a)))
double code(double a, double b, double c) {
return b * (-0.6666666666666666 / 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 * ((-0.6666666666666666d0) / a)
end function
public static double code(double a, double b, double c) {
return b * (-0.6666666666666666 / a);
}
def code(a, b, c): return b * (-0.6666666666666666 / a)
function code(a, b, c) return Float64(b * Float64(-0.6666666666666666 / a)) end
function tmp = code(a, b, c) tmp = b * (-0.6666666666666666 / a); end
code[a_, b_, c_] := N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Initial program 53.4%
sqr-neg53.4%
sqr-neg53.4%
associate-*l*53.4%
Simplified53.4%
Taylor expanded in b around -inf 34.5%
*-commutative34.5%
Simplified34.5%
Taylor expanded in b around 0 34.5%
*-commutative34.5%
associate-*l/34.5%
associate-/l*34.5%
Simplified34.5%
herbie shell --seed 2024130
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))