
(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 -5.6e+76)
(/ (* b -0.6666666666666666) a)
(if (<= b 7.3e-81)
(/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.6e+76) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 7.3e-81) {
tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} 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 <= (-5.6d+76)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 7.3d-81) then
tmp = (sqrt(((b * b) - ((a * 3.0d0) * c))) - b) / (a * 3.0d0)
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 <= -5.6e+76) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 7.3e-81) {
tmp = (Math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.6e+76: tmp = (b * -0.6666666666666666) / a elif b <= 7.3e-81: tmp = (math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.6e+76) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 7.3e-81) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * c))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.6e+76) tmp = (b * -0.6666666666666666) / a; elseif (b <= 7.3e-81) tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.6e+76], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 7.3e-81], 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[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+76}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 7.3 \cdot 10^{-81}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -5.5999999999999997e76Initial program 54.2%
Taylor expanded in b around -inf 93.2%
*-commutative93.2%
Simplified93.2%
associate-*l/93.5%
Applied egg-rr93.5%
if -5.5999999999999997e76 < b < 7.3000000000000002e-81Initial program 80.1%
if 7.3000000000000002e-81 < b Initial program 19.0%
associate-*r*19.0%
cancel-sign-sub-inv19.0%
metadata-eval19.0%
*-commutative19.0%
associate-*r*18.9%
Applied egg-rr18.9%
Taylor expanded in b around inf 85.4%
associate-*r/85.4%
*-commutative85.4%
Simplified85.4%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -1.18e+95)
(/ (* b -0.6666666666666666) a)
(if (<= b 6.7e-81)
(* -0.3333333333333333 (/ (- b (sqrt (- (* b b) (* 3.0 (* a c))))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.18e+95) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 6.7e-81) {
tmp = -0.3333333333333333 * ((b - sqrt(((b * b) - (3.0 * (a * c))))) / 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 <= (-1.18d+95)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 6.7d-81) then
tmp = (-0.3333333333333333d0) * ((b - sqrt(((b * b) - (3.0d0 * (a * c))))) / 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 <= -1.18e+95) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 6.7e-81) {
tmp = -0.3333333333333333 * ((b - Math.sqrt(((b * b) - (3.0 * (a * c))))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.18e+95: tmp = (b * -0.6666666666666666) / a elif b <= 6.7e-81: tmp = -0.3333333333333333 * ((b - math.sqrt(((b * b) - (3.0 * (a * c))))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.18e+95) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 6.7e-81) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c))))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.18e+95) tmp = (b * -0.6666666666666666) / a; elseif (b <= 6.7e-81) tmp = -0.3333333333333333 * ((b - sqrt(((b * b) - (3.0 * (a * c))))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.18e+95], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 6.7e-81], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.18 \cdot 10^{+95}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 6.7 \cdot 10^{-81}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.17999999999999998e95Initial program 50.0%
Taylor expanded in b around -inf 92.6%
*-commutative92.6%
Simplified92.6%
associate-*l/92.9%
Applied egg-rr92.9%
if -1.17999999999999998e95 < b < 6.70000000000000021e-81Initial program 81.1%
/-rgt-identity81.1%
metadata-eval81.1%
associate-/l*81.1%
associate-*r/81.0%
*-commutative81.0%
associate-*l/81.1%
associate-*r/81.1%
metadata-eval81.1%
metadata-eval81.1%
times-frac81.1%
neg-mul-181.1%
distribute-rgt-neg-in81.1%
times-frac80.9%
metadata-eval80.9%
neg-mul-180.9%
Simplified80.9%
fma-udef80.9%
associate-*r*80.9%
*-commutative80.9%
metadata-eval80.9%
cancel-sign-sub-inv80.9%
Applied egg-rr80.9%
if 6.70000000000000021e-81 < b Initial program 19.0%
associate-*r*19.0%
cancel-sign-sub-inv19.0%
metadata-eval19.0%
*-commutative19.0%
associate-*r*18.9%
Applied egg-rr18.9%
Taylor expanded in b around inf 85.4%
associate-*r/85.4%
*-commutative85.4%
Simplified85.4%
Final simplification85.2%
(FPCore (a b c)
:precision binary64
(if (<= b -1.06e+77)
(/ (* b -0.6666666666666666) a)
(if (<= b 2.2e-81)
(/ (- (sqrt (+ (* b b) (* a (* c -3.0)))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.06e+77) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2.2e-81) {
tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
} 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 <= (-1.06d+77)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 2.2d-81) then
tmp = (sqrt(((b * b) + (a * (c * (-3.0d0))))) - b) / (a * 3.0d0)
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 <= -1.06e+77) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2.2e-81) {
tmp = (Math.sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.06e+77: tmp = (b * -0.6666666666666666) / a elif b <= 2.2e-81: tmp = (math.sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.06e+77) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 2.2e-81) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.06e+77) tmp = (b * -0.6666666666666666) / a; elseif (b <= 2.2e-81) tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.06e+77], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 2.2e-81], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.06 \cdot 10^{+77}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-81}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.06000000000000003e77Initial program 54.2%
Taylor expanded in b around -inf 93.2%
*-commutative93.2%
Simplified93.2%
associate-*l/93.5%
Applied egg-rr93.5%
if -1.06000000000000003e77 < b < 2.1999999999999999e-81Initial program 80.1%
associate-*r*79.9%
cancel-sign-sub-inv79.9%
metadata-eval79.9%
*-commutative79.9%
associate-*r*80.0%
Applied egg-rr80.0%
if 2.1999999999999999e-81 < b Initial program 19.0%
associate-*r*19.0%
cancel-sign-sub-inv19.0%
metadata-eval19.0%
*-commutative19.0%
associate-*r*18.9%
Applied egg-rr18.9%
Taylor expanded in b around inf 85.4%
associate-*r/85.4%
*-commutative85.4%
Simplified85.4%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -3.6e-33)
(* b (/ -0.6666666666666666 a))
(if (<= b 3.5e-81)
(/ -0.3333333333333333 (/ a (- b (sqrt (* -3.0 (* a c))))))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.6e-33) {
tmp = b * (-0.6666666666666666 / a);
} else if (b <= 3.5e-81) {
tmp = -0.3333333333333333 / (a / (b - sqrt((-3.0 * (a * c)))));
} 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.6d-33)) then
tmp = b * ((-0.6666666666666666d0) / a)
else if (b <= 3.5d-81) then
tmp = (-0.3333333333333333d0) / (a / (b - sqrt(((-3.0d0) * (a * c)))))
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.6e-33) {
tmp = b * (-0.6666666666666666 / a);
} else if (b <= 3.5e-81) {
tmp = -0.3333333333333333 / (a / (b - Math.sqrt((-3.0 * (a * c)))));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.6e-33: tmp = b * (-0.6666666666666666 / a) elif b <= 3.5e-81: tmp = -0.3333333333333333 / (a / (b - math.sqrt((-3.0 * (a * c))))) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.6e-33) tmp = Float64(b * Float64(-0.6666666666666666 / a)); elseif (b <= 3.5e-81) tmp = Float64(-0.3333333333333333 / Float64(a / Float64(b - sqrt(Float64(-3.0 * Float64(a * c)))))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.6e-33) tmp = b * (-0.6666666666666666 / a); elseif (b <= 3.5e-81) tmp = -0.3333333333333333 / (a / (b - sqrt((-3.0 * (a * c))))); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.6e-33], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.5e-81], N[(-0.3333333333333333 / N[(a / N[(b - N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.6 \cdot 10^{-33}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-81}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{a}{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.60000000000000034e-33Initial program 63.2%
associate-*r*63.2%
cancel-sign-sub-inv63.2%
metadata-eval63.2%
*-commutative63.2%
associate-*r*63.2%
Applied egg-rr63.2%
Taylor expanded in b around -inf 86.6%
associate-*r/86.8%
associate-/l*86.7%
Simplified86.7%
associate-/r/86.8%
Applied egg-rr86.8%
if -3.60000000000000034e-33 < b < 3.49999999999999986e-81Initial program 77.6%
/-rgt-identity77.6%
metadata-eval77.6%
associate-/l*77.6%
associate-*r/77.5%
*-commutative77.5%
associate-*l/77.6%
associate-*r/77.6%
metadata-eval77.6%
metadata-eval77.6%
times-frac77.6%
neg-mul-177.6%
distribute-rgt-neg-in77.6%
times-frac77.3%
metadata-eval77.3%
neg-mul-177.3%
Simplified77.3%
fma-udef77.3%
associate-*r*77.2%
*-commutative77.2%
metadata-eval77.2%
cancel-sign-sub-inv77.2%
Applied egg-rr77.2%
expm1-log1p-u57.8%
expm1-udef21.9%
*-commutative21.9%
cancel-sign-sub-inv21.9%
fma-def21.9%
metadata-eval21.9%
Applied egg-rr21.9%
expm1-def57.8%
expm1-log1p77.2%
associate-*l/77.3%
*-commutative77.3%
associate-/l*77.2%
associate-*r*77.3%
*-commutative77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in b around 0 70.3%
if 3.49999999999999986e-81 < b Initial program 19.0%
associate-*r*19.0%
cancel-sign-sub-inv19.0%
metadata-eval19.0%
*-commutative19.0%
associate-*r*18.9%
Applied egg-rr18.9%
Taylor expanded in b around inf 85.4%
associate-*r/85.4%
*-commutative85.4%
Simplified85.4%
Final simplification81.4%
(FPCore (a b c)
:precision binary64
(if (<= b -3.5e-33)
(* b (/ -0.6666666666666666 a))
(if (<= b 2.4e-81)
(/ -0.3333333333333333 (/ a (- b (sqrt (* c (* a -3.0))))))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e-33) {
tmp = b * (-0.6666666666666666 / a);
} else if (b <= 2.4e-81) {
tmp = -0.3333333333333333 / (a / (b - sqrt((c * (a * -3.0)))));
} 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-33)) then
tmp = b * ((-0.6666666666666666d0) / a)
else if (b <= 2.4d-81) then
tmp = (-0.3333333333333333d0) / (a / (b - sqrt((c * (a * (-3.0d0))))))
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-33) {
tmp = b * (-0.6666666666666666 / a);
} else if (b <= 2.4e-81) {
tmp = -0.3333333333333333 / (a / (b - Math.sqrt((c * (a * -3.0)))));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.5e-33: tmp = b * (-0.6666666666666666 / a) elif b <= 2.4e-81: tmp = -0.3333333333333333 / (a / (b - math.sqrt((c * (a * -3.0))))) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.5e-33) tmp = Float64(b * Float64(-0.6666666666666666 / a)); elseif (b <= 2.4e-81) tmp = Float64(-0.3333333333333333 / Float64(a / Float64(b - sqrt(Float64(c * Float64(a * -3.0)))))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.5e-33) tmp = b * (-0.6666666666666666 / a); elseif (b <= 2.4e-81) tmp = -0.3333333333333333 / (a / (b - sqrt((c * (a * -3.0))))); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.5e-33], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.4e-81], N[(-0.3333333333333333 / N[(a / N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{-33}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-81}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{a}{b - \sqrt{c \cdot \left(a \cdot -3\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.4999999999999999e-33Initial program 63.2%
associate-*r*63.2%
cancel-sign-sub-inv63.2%
metadata-eval63.2%
*-commutative63.2%
associate-*r*63.2%
Applied egg-rr63.2%
Taylor expanded in b around -inf 86.6%
associate-*r/86.8%
associate-/l*86.7%
Simplified86.7%
associate-/r/86.8%
Applied egg-rr86.8%
if -3.4999999999999999e-33 < b < 2.3999999999999999e-81Initial program 77.6%
/-rgt-identity77.6%
metadata-eval77.6%
associate-/l*77.6%
associate-*r/77.5%
*-commutative77.5%
associate-*l/77.6%
associate-*r/77.6%
metadata-eval77.6%
metadata-eval77.6%
times-frac77.6%
neg-mul-177.6%
distribute-rgt-neg-in77.6%
times-frac77.3%
metadata-eval77.3%
neg-mul-177.3%
Simplified77.3%
fma-udef77.3%
associate-*r*77.2%
*-commutative77.2%
metadata-eval77.2%
cancel-sign-sub-inv77.2%
Applied egg-rr77.2%
expm1-log1p-u57.8%
expm1-udef21.9%
*-commutative21.9%
cancel-sign-sub-inv21.9%
fma-def21.9%
metadata-eval21.9%
Applied egg-rr21.9%
expm1-def57.8%
expm1-log1p77.2%
associate-*l/77.3%
*-commutative77.3%
associate-/l*77.2%
associate-*r*77.3%
*-commutative77.3%
*-commutative77.3%
Simplified77.3%
Taylor expanded in b around 0 70.3%
*-commutative70.3%
associate-*r*70.4%
Simplified70.4%
if 2.3999999999999999e-81 < b Initial program 19.0%
associate-*r*19.0%
cancel-sign-sub-inv19.0%
metadata-eval19.0%
*-commutative19.0%
associate-*r*18.9%
Applied egg-rr18.9%
Taylor expanded in b around inf 85.4%
associate-*r/85.4%
*-commutative85.4%
Simplified85.4%
Final simplification81.5%
(FPCore (a b c)
:precision binary64
(if (<= b -5.2e-33)
(* b (/ -0.6666666666666666 a))
(if (<= b 7.9e-81)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.2e-33) {
tmp = b * (-0.6666666666666666 / a);
} else if (b <= 7.9e-81) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} 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 <= (-5.2d-33)) then
tmp = b * ((-0.6666666666666666d0) / a)
else if (b <= 7.9d-81) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
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 <= -5.2e-33) {
tmp = b * (-0.6666666666666666 / a);
} else if (b <= 7.9e-81) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.2e-33: tmp = b * (-0.6666666666666666 / a) elif b <= 7.9e-81: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.2e-33) tmp = Float64(b * Float64(-0.6666666666666666 / a)); elseif (b <= 7.9e-81) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.2e-33) tmp = b * (-0.6666666666666666 / a); elseif (b <= 7.9e-81) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.2e-33], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.9e-81], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{-33}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 7.9 \cdot 10^{-81}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -5.19999999999999988e-33Initial program 63.2%
associate-*r*63.2%
cancel-sign-sub-inv63.2%
metadata-eval63.2%
*-commutative63.2%
associate-*r*63.2%
Applied egg-rr63.2%
Taylor expanded in b around -inf 86.6%
associate-*r/86.8%
associate-/l*86.7%
Simplified86.7%
associate-/r/86.8%
Applied egg-rr86.8%
if -5.19999999999999988e-33 < b < 7.90000000000000016e-81Initial program 77.6%
Taylor expanded in b around 0 70.4%
*-commutative70.4%
*-commutative70.4%
*-commutative70.4%
associate-*l*70.6%
Simplified70.6%
if 7.90000000000000016e-81 < b Initial program 19.0%
associate-*r*19.0%
cancel-sign-sub-inv19.0%
metadata-eval19.0%
*-commutative19.0%
associate-*r*18.9%
Applied egg-rr18.9%
Taylor expanded in b around inf 85.4%
associate-*r/85.4%
*-commutative85.4%
Simplified85.4%
Final simplification81.5%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (+ (/ (* b 2.0) (* a -3.0)) (* 0.5 (/ c b))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = ((b * 2.0) / (a * -3.0)) + (0.5 * (c / b));
} 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 <= (-5d-310)) then
tmp = ((b * 2.0d0) / (a * (-3.0d0))) + (0.5d0 * (c / b))
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 <= -5e-310) {
tmp = ((b * 2.0) / (a * -3.0)) + (0.5 * (c / b));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = ((b * 2.0) / (a * -3.0)) + (0.5 * (c / b)) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(Float64(b * 2.0) / Float64(a * -3.0)) + Float64(0.5 * Float64(c / b))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = ((b * 2.0) / (a * -3.0)) + (0.5 * (c / b)); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(b * 2.0), $MachinePrecision] / N[(a * -3.0), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot 2}{a \cdot -3} + 0.5 \cdot \frac{c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 69.9%
Taylor expanded in b around -inf 67.6%
metadata-eval67.6%
times-frac67.7%
*-commutative67.7%
frac-2neg67.7%
distribute-rgt-neg-in67.7%
metadata-eval67.7%
distribute-lft-neg-in67.7%
metadata-eval67.7%
*-commutative67.7%
Applied egg-rr67.7%
if -4.999999999999985e-310 < b Initial program 33.5%
associate-*r*33.3%
cancel-sign-sub-inv33.3%
metadata-eval33.3%
*-commutative33.3%
associate-*r*33.4%
Applied egg-rr33.4%
Taylor expanded in b around inf 65.0%
associate-*r/65.1%
*-commutative65.1%
Simplified65.1%
Final simplification66.3%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (+ (* 0.5 (/ c b)) (* -0.6666666666666666 (/ b a))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / 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 <= (-5d-310)) then
tmp = (0.5d0 * (c / b)) + ((-0.6666666666666666d0) * (b / 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 <= -5e-310) {
tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / a));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / a)) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(0.5 * Float64(c / b)) + Float64(-0.6666666666666666 * Float64(b / a))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / a)); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} + -0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 69.9%
Taylor expanded in b around -inf 67.6%
if -4.999999999999985e-310 < b Initial program 33.5%
associate-*r*33.3%
cancel-sign-sub-inv33.3%
metadata-eval33.3%
*-commutative33.3%
associate-*r*33.4%
Applied egg-rr33.4%
Taylor expanded in b around inf 65.0%
associate-*r/65.1%
*-commutative65.1%
Simplified65.1%
Final simplification66.2%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (b * -2.0) / (a * 3.0);
} 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 <= (-5d-310)) then
tmp = (b * (-2.0d0)) / (a * 3.0d0)
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 <= -5e-310) {
tmp = (b * -2.0) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (b * -2.0) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-310) tmp = (b * -2.0) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 69.9%
Taylor expanded in b around -inf 67.2%
*-commutative67.2%
Simplified67.2%
if -4.999999999999985e-310 < b Initial program 33.5%
associate-*r*33.3%
cancel-sign-sub-inv33.3%
metadata-eval33.3%
*-commutative33.3%
associate-*r*33.4%
Applied egg-rr33.4%
Taylor expanded in b around inf 65.0%
associate-*r/65.1%
*-commutative65.1%
Simplified65.1%
Final simplification66.0%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (* b (/ -0.6666666666666666 a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-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 <= (-5d-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 <= -5e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-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 <= -5e-310) tmp = b * (-0.6666666666666666 / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-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 -5 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 69.9%
associate-*r*69.8%
cancel-sign-sub-inv69.8%
metadata-eval69.8%
*-commutative69.8%
associate-*r*69.8%
Applied egg-rr69.8%
Taylor expanded in b around -inf 67.1%
associate-*r/67.2%
associate-/l*67.2%
Simplified67.2%
associate-/r/67.2%
Applied egg-rr67.2%
if -4.999999999999985e-310 < b Initial program 33.5%
Taylor expanded in b around inf 65.0%
Final simplification66.0%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (* b -0.6666666666666666) a) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-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 <= (-5d-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 <= -5e-310) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (b * -0.6666666666666666) / a else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(b * -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 <= -5e-310) tmp = (b * -0.6666666666666666) / a; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 69.9%
Taylor expanded in b around -inf 67.1%
*-commutative67.1%
Simplified67.1%
associate-*l/67.2%
Applied egg-rr67.2%
if -4.999999999999985e-310 < b Initial program 33.5%
Taylor expanded in b around inf 65.0%
Final simplification66.0%
(FPCore (a b c) :precision binary64 (if (<= b 6.5e-309) (/ (* b -0.6666666666666666) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 6.5e-309) {
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 <= 6.5d-309) 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 <= 6.5e-309) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 6.5e-309: tmp = (b * -0.6666666666666666) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 6.5e-309) tmp = Float64(Float64(b * -0.6666666666666666) / a); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 6.5e-309) tmp = (b * -0.6666666666666666) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 6.5e-309], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{-309}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 6.4999999999999999e-309Initial program 69.9%
Taylor expanded in b around -inf 67.1%
*-commutative67.1%
Simplified67.1%
associate-*l/67.2%
Applied egg-rr67.2%
if 6.4999999999999999e-309 < b Initial program 33.5%
associate-*r*33.3%
cancel-sign-sub-inv33.3%
metadata-eval33.3%
*-commutative33.3%
associate-*r*33.4%
Applied egg-rr33.4%
Taylor expanded in b around inf 65.0%
associate-*r/65.1%
*-commutative65.1%
Simplified65.1%
Final simplification66.0%
(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.8%
Taylor expanded in b around inf 36.8%
Final simplification36.8%
herbie shell --seed 2023256
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))