
(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 -6e-7)
(/ (/ b a) -1.5)
(if (<= b 2.5e-91)
(/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6e-7) {
tmp = (b / a) / -1.5;
} else if (b <= 2.5e-91) {
tmp = (sqrt(((b * b) - ((a * 3.0) * 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 <= (-6d-7)) then
tmp = (b / a) / (-1.5d0)
else if (b <= 2.5d-91) then
tmp = (sqrt(((b * b) - ((a * 3.0d0) * 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 <= -6e-7) {
tmp = (b / a) / -1.5;
} else if (b <= 2.5e-91) {
tmp = (Math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6e-7: tmp = (b / a) / -1.5 elif b <= 2.5e-91: tmp = (math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6e-7) tmp = Float64(Float64(b / a) / -1.5); elseif (b <= 2.5e-91) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * 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 <= -6e-7) tmp = (b / a) / -1.5; elseif (b <= 2.5e-91) tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6e-7], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], If[LessEqual[b, 2.5e-91], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 3.0), $MachinePrecision] * 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 -6 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-91}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -5.9999999999999997e-7Initial program 62.1%
Applied egg-rr44.5%
sub-neg44.5%
distribute-rgt-out--44.5%
Simplified44.5%
Taylor expanded in b around -inf 92.6%
*-commutative92.6%
associate-*l/92.7%
associate-*r/92.6%
Simplified92.6%
associate-*r/92.7%
metadata-eval92.7%
div-inv92.7%
associate-/l/92.7%
associate-/r*92.8%
Applied egg-rr92.8%
if -5.9999999999999997e-7 < b < 2.49999999999999999e-91Initial program 75.3%
if 2.49999999999999999e-91 < b Initial program 10.7%
Taylor expanded in b around inf 86.9%
Final simplification84.7%
(FPCore (a b c)
:precision binary64
(if (<= b -1.7e-100)
(fma -0.6666666666666666 (/ b a) (* (/ c b) 0.5))
(if (<= b 1.46e-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.7e-100) {
tmp = fma(-0.6666666666666666, (b / a), ((c / b) * 0.5));
} else if (b <= 1.46e-95) {
tmp = (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.7e-100) tmp = fma(-0.6666666666666666, Float64(b / a), Float64(Float64(c / b) * 0.5)); elseif (b <= 1.46e-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
code[a_, b_, c_] := If[LessEqual[b, -1.7e-100], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.46e-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.7 \cdot 10^{-100}:\\
\;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, \frac{c}{b} \cdot 0.5\right)\\
\mathbf{elif}\;b \leq 1.46 \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.69999999999999988e-100Initial program 66.6%
Taylor expanded in b around -inf 88.4%
fma-def88.4%
Simplified88.4%
if -1.69999999999999988e-100 < b < 1.45999999999999999e-95Initial program 72.6%
prod-diff72.2%
*-commutative72.2%
fma-def72.2%
associate-+l+72.2%
pow272.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
metadata-eval72.2%
*-commutative72.2%
fma-udef72.2%
distribute-lft-neg-in72.2%
distribute-rgt-neg-in72.2%
*-commutative72.2%
distribute-rgt-neg-in72.2%
metadata-eval72.2%
*-commutative72.2%
associate-*l*72.2%
Applied egg-rr72.2%
fma-def72.2%
fma-def72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in b around 0 68.0%
distribute-rgt-out68.3%
metadata-eval68.3%
associate-*r*68.3%
mul-1-neg68.3%
unsub-neg68.3%
associate-*r*68.3%
*-commutative68.3%
associate-*l*68.4%
*-commutative68.4%
Simplified68.4%
if 1.45999999999999999e-95 < b Initial program 11.7%
Taylor expanded in b around inf 86.2%
Final simplification81.9%
(FPCore (a b c)
:precision binary64
(if (<= b -2.55e-92)
(+ (* (/ c b) 0.5) (* (/ b a) -0.6666666666666666))
(if (<= b 4.4e-91)
(* 0.3333333333333333 (/ (sqrt (* -3.0 (* a c))) a))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.55e-92) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 4.4e-91) {
tmp = 0.3333333333333333 * (sqrt((-3.0 * (a * c))) / 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 <= (-2.55d-92)) then
tmp = ((c / b) * 0.5d0) + ((b / a) * (-0.6666666666666666d0))
else if (b <= 4.4d-91) then
tmp = 0.3333333333333333d0 * (sqrt(((-3.0d0) * (a * c))) / 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 <= -2.55e-92) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 4.4e-91) {
tmp = 0.3333333333333333 * (Math.sqrt((-3.0 * (a * c))) / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.55e-92: tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666) elif b <= 4.4e-91: tmp = 0.3333333333333333 * (math.sqrt((-3.0 * (a * c))) / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.55e-92) tmp = Float64(Float64(Float64(c / b) * 0.5) + Float64(Float64(b / a) * -0.6666666666666666)); elseif (b <= 4.4e-91) tmp = Float64(0.3333333333333333 * Float64(sqrt(Float64(-3.0 * Float64(a * c))) / 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 <= -2.55e-92) tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666); elseif (b <= 4.4e-91) tmp = 0.3333333333333333 * (sqrt((-3.0 * (a * c))) / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.55e-92], N[(N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.4e-91], N[(0.3333333333333333 * N[(N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.55 \cdot 10^{-92}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 + \frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-91}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -2.54999999999999986e-92Initial program 66.6%
Taylor expanded in b around -inf 88.4%
if -2.54999999999999986e-92 < b < 4.4000000000000002e-91Initial program 72.0%
prod-diff71.7%
*-commutative71.7%
fma-def71.7%
associate-+l+71.7%
pow271.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
fma-udef71.7%
distribute-lft-neg-in71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
associate-*l*71.7%
Applied egg-rr71.7%
fma-def71.7%
fma-def71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in b around 0 66.0%
associate-*l/66.1%
distribute-rgt-out66.4%
*-commutative66.4%
metadata-eval66.4%
*-lft-identity66.4%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in c around 0 66.4%
if 4.4000000000000002e-91 < b Initial program 10.7%
Taylor expanded in b around inf 86.9%
Final simplification81.5%
(FPCore (a b c)
:precision binary64
(if (<= b -2.2e-103)
(+ (* (/ c b) 0.5) (* (/ b a) -0.6666666666666666))
(if (<= b 1.7e-91)
(/ 0.3333333333333333 (/ a (sqrt (* c (* a -3.0)))))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.2e-103) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 1.7e-91) {
tmp = 0.3333333333333333 / (a / sqrt((c * (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 <= (-2.2d-103)) then
tmp = ((c / b) * 0.5d0) + ((b / a) * (-0.6666666666666666d0))
else if (b <= 1.7d-91) then
tmp = 0.3333333333333333d0 / (a / sqrt((c * (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 <= -2.2e-103) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 1.7e-91) {
tmp = 0.3333333333333333 / (a / Math.sqrt((c * (a * -3.0))));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.2e-103: tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666) elif b <= 1.7e-91: tmp = 0.3333333333333333 / (a / math.sqrt((c * (a * -3.0)))) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.2e-103) tmp = Float64(Float64(Float64(c / b) * 0.5) + Float64(Float64(b / a) * -0.6666666666666666)); elseif (b <= 1.7e-91) tmp = Float64(0.3333333333333333 / Float64(a / sqrt(Float64(c * 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 <= -2.2e-103) tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666); elseif (b <= 1.7e-91) tmp = 0.3333333333333333 / (a / sqrt((c * (a * -3.0)))); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.2e-103], N[(N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.7e-91], N[(0.3333333333333333 / N[(a / N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 + \frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-91}:\\
\;\;\;\;\frac{0.3333333333333333}{\frac{a}{\sqrt{c \cdot \left(a \cdot -3\right)}}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -2.1999999999999999e-103Initial program 66.6%
Taylor expanded in b around -inf 88.4%
if -2.1999999999999999e-103 < b < 1.70000000000000013e-91Initial program 72.0%
prod-diff71.7%
*-commutative71.7%
fma-def71.7%
associate-+l+71.7%
pow271.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
fma-udef71.7%
distribute-lft-neg-in71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
associate-*l*71.7%
Applied egg-rr71.7%
fma-def71.7%
fma-def71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in b around 0 66.0%
associate-*l/66.1%
distribute-rgt-out66.4%
*-commutative66.4%
metadata-eval66.4%
*-lft-identity66.4%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
clear-num66.4%
un-div-inv66.6%
sqrt-prod39.9%
*-commutative39.9%
sqrt-prod66.6%
Applied egg-rr66.6%
if 1.70000000000000013e-91 < b Initial program 10.7%
Taylor expanded in b around inf 86.9%
Final simplification81.5%
(FPCore (a b c)
:precision binary64
(if (<= b -5e-100)
(+ (* (/ c b) 0.5) (* (/ b a) -0.6666666666666666))
(if (<= b 1.36e-91)
(/ (* 0.3333333333333333 (sqrt (* -3.0 (* a c)))) a)
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-100) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 1.36e-91) {
tmp = (0.3333333333333333 * sqrt((-3.0 * (a * c)))) / 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 <= (-5d-100)) then
tmp = ((c / b) * 0.5d0) + ((b / a) * (-0.6666666666666666d0))
else if (b <= 1.36d-91) then
tmp = (0.3333333333333333d0 * sqrt(((-3.0d0) * (a * c)))) / 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 <= -5e-100) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 1.36e-91) {
tmp = (0.3333333333333333 * Math.sqrt((-3.0 * (a * c)))) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-100: tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666) elif b <= 1.36e-91: tmp = (0.3333333333333333 * math.sqrt((-3.0 * (a * c)))) / a else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-100) tmp = Float64(Float64(Float64(c / b) * 0.5) + Float64(Float64(b / a) * -0.6666666666666666)); elseif (b <= 1.36e-91) tmp = Float64(Float64(0.3333333333333333 * sqrt(Float64(-3.0 * Float64(a * c)))) / 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 <= -5e-100) tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666); elseif (b <= 1.36e-91) tmp = (0.3333333333333333 * sqrt((-3.0 * (a * c)))) / a; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-100], N[(N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.36e-91], N[(N[(0.3333333333333333 * N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-100}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 + \frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 1.36 \cdot 10^{-91}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -5.0000000000000001e-100Initial program 66.6%
Taylor expanded in b around -inf 88.4%
if -5.0000000000000001e-100 < b < 1.3600000000000001e-91Initial program 72.0%
prod-diff71.7%
*-commutative71.7%
fma-def71.7%
associate-+l+71.7%
pow271.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
fma-udef71.7%
distribute-lft-neg-in71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
associate-*l*71.7%
Applied egg-rr71.7%
fma-def71.7%
fma-def71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in b around 0 66.0%
associate-*l/66.1%
distribute-rgt-out66.4%
*-commutative66.4%
metadata-eval66.4%
*-lft-identity66.4%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
associate-*r/66.5%
sqrt-prod39.9%
*-commutative39.9%
sqrt-prod66.5%
Applied egg-rr66.5%
Taylor expanded in c around 0 66.6%
if 1.3600000000000001e-91 < b Initial program 10.7%
Taylor expanded in b around inf 86.9%
Final simplification81.5%
(FPCore (a b c)
:precision binary64
(if (<= b -5.9e-102)
(fma -0.6666666666666666 (/ b a) (* (/ c b) 0.5))
(if (<= b 4.8e-88)
(/ (* 0.3333333333333333 (sqrt (* -3.0 (* a c)))) a)
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.9e-102) {
tmp = fma(-0.6666666666666666, (b / a), ((c / b) * 0.5));
} else if (b <= 4.8e-88) {
tmp = (0.3333333333333333 * sqrt((-3.0 * (a * c)))) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -5.9e-102) tmp = fma(-0.6666666666666666, Float64(b / a), Float64(Float64(c / b) * 0.5)); elseif (b <= 4.8e-88) tmp = Float64(Float64(0.3333333333333333 * sqrt(Float64(-3.0 * Float64(a * c)))) / a); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -5.9e-102], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.8e-88], N[(N[(0.3333333333333333 * N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.9 \cdot 10^{-102}:\\
\;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, \frac{c}{b} \cdot 0.5\right)\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{-88}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -5.9000000000000003e-102Initial program 66.6%
Taylor expanded in b around -inf 88.4%
fma-def88.4%
Simplified88.4%
if -5.9000000000000003e-102 < b < 4.7999999999999999e-88Initial program 72.0%
prod-diff71.7%
*-commutative71.7%
fma-def71.7%
associate-+l+71.7%
pow271.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
fma-udef71.7%
distribute-lft-neg-in71.7%
distribute-rgt-neg-in71.7%
*-commutative71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
*-commutative71.7%
associate-*l*71.7%
Applied egg-rr71.7%
fma-def71.7%
fma-def71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in b around 0 66.0%
associate-*l/66.1%
distribute-rgt-out66.4%
*-commutative66.4%
metadata-eval66.4%
*-lft-identity66.4%
associate-*l*66.4%
*-commutative66.4%
Simplified66.4%
associate-*r/66.5%
sqrt-prod39.9%
*-commutative39.9%
sqrt-prod66.5%
Applied egg-rr66.5%
Taylor expanded in c around 0 66.6%
if 4.7999999999999999e-88 < b Initial program 10.7%
Taylor expanded in b around inf 86.9%
Final simplification81.5%
(FPCore (a b c)
:precision binary64
(if (<= b -2.4e-181)
(+ (* (/ c b) 0.5) (* (/ b a) -0.6666666666666666))
(if (<= b 5.6e-171)
(sqrt (* 0.1111111111111111 (/ c (/ a -3.0))))
(* -0.5 (/ c b)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e-181) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 5.6e-171) {
tmp = sqrt((0.1111111111111111 * (c / (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 <= (-2.4d-181)) then
tmp = ((c / b) * 0.5d0) + ((b / a) * (-0.6666666666666666d0))
else if (b <= 5.6d-171) then
tmp = sqrt((0.1111111111111111d0 * (c / (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 <= -2.4e-181) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else if (b <= 5.6e-171) {
tmp = Math.sqrt((0.1111111111111111 * (c / (a / -3.0))));
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.4e-181: tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666) elif b <= 5.6e-171: tmp = math.sqrt((0.1111111111111111 * (c / (a / -3.0)))) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.4e-181) tmp = Float64(Float64(Float64(c / b) * 0.5) + Float64(Float64(b / a) * -0.6666666666666666)); elseif (b <= 5.6e-171) tmp = sqrt(Float64(0.1111111111111111 * Float64(c / 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 <= -2.4e-181) tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666); elseif (b <= 5.6e-171) tmp = sqrt((0.1111111111111111 * (c / (a / -3.0)))); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.4e-181], N[(N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e-171], N[Sqrt[N[(0.1111111111111111 * N[(c / N[(a / -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-181}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 + \frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{-171}:\\
\;\;\;\;\sqrt{0.1111111111111111 \cdot \frac{c}{\frac{a}{-3}}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -2.4000000000000001e-181Initial program 67.4%
Taylor expanded in b around -inf 81.9%
if -2.4000000000000001e-181 < b < 5.60000000000000046e-171Initial program 76.4%
prod-diff76.1%
*-commutative76.1%
fma-def76.1%
associate-+l+76.1%
pow276.1%
*-commutative76.1%
distribute-rgt-neg-in76.1%
*-commutative76.1%
distribute-rgt-neg-in76.1%
metadata-eval76.1%
*-commutative76.1%
fma-udef76.1%
distribute-lft-neg-in76.1%
distribute-rgt-neg-in76.1%
*-commutative76.1%
distribute-rgt-neg-in76.1%
metadata-eval76.1%
*-commutative76.1%
associate-*l*76.1%
Applied egg-rr76.1%
fma-def76.1%
fma-def76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in b around 0 75.2%
associate-*l/75.2%
distribute-rgt-out75.5%
*-commutative75.5%
metadata-eval75.5%
*-lft-identity75.5%
associate-*l*75.5%
*-commutative75.5%
Simplified75.5%
add-sqr-sqrt42.2%
sqrt-unprod30.2%
*-commutative30.2%
*-commutative30.2%
swap-sqr30.4%
frac-times25.7%
add-sqr-sqrt25.8%
*-commutative25.8%
pow225.8%
metadata-eval25.8%
Applied egg-rr25.8%
*-commutative25.8%
associate-/l*28.4%
unpow228.4%
times-frac36.8%
*-rgt-identity36.8%
associate-*r/36.8%
rgt-mult-inverse36.8%
Simplified36.8%
if 5.60000000000000046e-171 < b Initial program 18.7%
Taylor expanded in b around inf 79.2%
Final simplification72.9%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (+ (* (/ c b) 0.5) (* (/ b a) -0.6666666666666666)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = ((c / b) * 0.5) + ((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 <= (-4d-310)) then
tmp = ((c / b) * 0.5d0) + ((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 <= -4e-310) {
tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(Float64(Float64(c / b) * 0.5) + 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 <= -4e-310) tmp = ((c / b) * 0.5) + ((b / a) * -0.6666666666666666); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision] + N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 + \frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 69.5%
Taylor expanded in b around -inf 67.6%
if -3.999999999999988e-310 < b Initial program 27.4%
Taylor expanded in b around inf 69.2%
Final simplification68.4%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (* b (/ -0.6666666666666666 a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = b * (-0.6666666666666666 / 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 <= (-4d-310)) then
tmp = b * ((-0.6666666666666666d0) / 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 <= -4e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(b * Float64(-0.6666666666666666 / 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 <= -4e-310) tmp = b * (-0.6666666666666666 / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 69.5%
Applied egg-rr56.0%
sub-neg56.0%
distribute-rgt-out--56.0%
Simplified56.0%
Taylor expanded in b around -inf 67.3%
*-commutative67.3%
associate-*l/67.4%
associate-*r/67.4%
Simplified67.4%
if -3.999999999999988e-310 < b Initial program 27.4%
Taylor expanded in b around inf 69.2%
Final simplification68.2%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (/ b (* a -1.5)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = b / (a * -1.5);
} 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 <= (-4d-310)) then
tmp = b / (a * (-1.5d0))
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 <= -4e-310) {
tmp = b / (a * -1.5);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = b / (a * -1.5) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = b / (a * -1.5); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 69.5%
Applied egg-rr56.0%
sub-neg56.0%
distribute-rgt-out--56.0%
Simplified56.0%
Taylor expanded in b around -inf 67.3%
*-commutative67.3%
associate-*l/67.4%
associate-*r/67.4%
Simplified67.4%
associate-*r/67.4%
associate-/l*67.3%
div-inv67.4%
metadata-eval67.4%
*-commutative67.4%
Applied egg-rr67.4%
if -3.999999999999988e-310 < b Initial program 27.4%
Taylor expanded in b around inf 69.2%
Final simplification68.3%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (/ (/ b -1.5) a) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = (b / -1.5) / 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 <= (-4d-310)) then
tmp = (b / (-1.5d0)) / 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 <= -4e-310) {
tmp = (b / -1.5) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = (b / -1.5) / a else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(Float64(b / -1.5) / 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 <= -4e-310) tmp = (b / -1.5) / a; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(N[(b / -1.5), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b}{-1.5}}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 69.5%
Taylor expanded in b around -inf 67.3%
*-commutative67.3%
Simplified67.3%
metadata-eval67.3%
times-frac67.4%
associate-/l/67.4%
associate-/l*67.4%
metadata-eval67.4%
Applied egg-rr67.4%
if -3.999999999999988e-310 < b Initial program 27.4%
Taylor expanded in b around inf 69.2%
Final simplification68.3%
(FPCore (a b c) :precision binary64 (if (<= b -4e-310) (/ (/ b a) -1.5) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4e-310) {
tmp = (b / a) / -1.5;
} 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 <= (-4d-310)) then
tmp = (b / a) / (-1.5d0)
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 <= -4e-310) {
tmp = (b / a) / -1.5;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4e-310: tmp = (b / a) / -1.5 else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4e-310) tmp = Float64(Float64(b / a) / -1.5); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4e-310) tmp = (b / a) / -1.5; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4e-310], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -3.999999999999988e-310Initial program 69.5%
Applied egg-rr56.0%
sub-neg56.0%
distribute-rgt-out--56.0%
Simplified56.0%
Taylor expanded in b around -inf 67.3%
*-commutative67.3%
associate-*l/67.4%
associate-*r/67.4%
Simplified67.4%
associate-*r/67.4%
metadata-eval67.4%
div-inv67.4%
associate-/l/67.4%
associate-/r*67.5%
Applied egg-rr67.5%
if -3.999999999999988e-310 < b Initial program 27.4%
Taylor expanded in b around inf 69.2%
Final simplification68.3%
(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 49.4%
Taylor expanded in b around inf 34.2%
Final simplification34.2%
herbie shell --seed 2023334
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))