
(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 14 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 -1.26e+148)
(/ (* b -0.6666666666666666) a)
(if (<= b 2e-117)
(/ (- (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 <= -1.26e+148) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2e-117) {
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 <= (-1.26d+148)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 2d-117) 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 <= -1.26e+148) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2e-117) {
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 <= -1.26e+148: tmp = (b * -0.6666666666666666) / a elif b <= 2e-117: 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 <= -1.26e+148) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 2e-117) 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 <= -1.26e+148) tmp = (b * -0.6666666666666666) / a; elseif (b <= 2e-117) 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, -1.26e+148], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 2e-117], 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 -1.26 \cdot 10^{+148}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-117}:\\
\;\;\;\;\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 < -1.25999999999999997e148Initial program 42.0%
sqr-neg42.0%
sqr-neg42.0%
associate-*l*42.0%
Simplified42.0%
Taylor expanded in b around -inf 99.6%
*-commutative99.6%
Simplified99.6%
associate-*l/99.8%
Applied egg-rr99.8%
if -1.25999999999999997e148 < b < 2.00000000000000006e-117Initial program 89.6%
if 2.00000000000000006e-117 < b Initial program 17.9%
sqr-neg17.9%
sqr-neg17.9%
associate-*l*17.9%
Simplified17.9%
Taylor expanded in b around inf 69.5%
associate-/l*69.5%
associate-/l*72.9%
*-commutative72.9%
Applied egg-rr72.9%
add-sqr-sqrt46.3%
sqrt-unprod40.0%
*-commutative40.0%
*-commutative40.0%
swap-sqr40.0%
pow240.0%
times-frac40.5%
*-inverses40.5%
*-un-lft-identity40.5%
div-inv40.4%
metadata-eval40.4%
metadata-eval40.4%
Applied egg-rr40.4%
*-commutative40.4%
metadata-eval40.4%
unpow240.4%
associate-*l/40.4%
metadata-eval40.4%
div-inv40.5%
clear-num40.5%
associate-/r*40.5%
associate-*l/40.5%
metadata-eval40.5%
div-inv40.5%
clear-num40.5%
associate-/r*40.4%
swap-sqr40.4%
div-inv40.5%
div-inv40.5%
sqrt-unprod51.1%
add-sqr-sqrt82.1%
associate-/r*84.0%
Applied egg-rr84.1%
Final simplification88.8%
(FPCore (a b c)
:precision binary64
(if (<= b -3e+148)
(/ (* b -0.6666666666666666) a)
(if (<= b 2.1e-117)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3e+148) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2.1e-117) {
tmp = (sqrt(((b * b) - (3.0 * (a * 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 <= (-3d+148)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 2.1d-117) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * 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 <= -3e+148) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2.1e-117) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3e+148: tmp = (b * -0.6666666666666666) / a elif b <= 2.1e-117: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3e+148) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 2.1e-117) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * 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 <= -3e+148) tmp = (b * -0.6666666666666666) / a; elseif (b <= 2.1e-117) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3e+148], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 2.1e-117], 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 * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+148}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.00000000000000015e148Initial program 42.0%
sqr-neg42.0%
sqr-neg42.0%
associate-*l*42.0%
Simplified42.0%
Taylor expanded in b around -inf 99.6%
*-commutative99.6%
Simplified99.6%
associate-*l/99.8%
Applied egg-rr99.8%
if -3.00000000000000015e148 < b < 2.0999999999999999e-117Initial program 89.6%
sqr-neg89.6%
sqr-neg89.6%
associate-*l*89.6%
Simplified89.6%
if 2.0999999999999999e-117 < b Initial program 17.9%
sqr-neg17.9%
sqr-neg17.9%
associate-*l*17.9%
Simplified17.9%
Taylor expanded in b around inf 69.5%
associate-/l*69.5%
associate-/l*72.9%
*-commutative72.9%
Applied egg-rr72.9%
add-sqr-sqrt46.3%
sqrt-unprod40.0%
*-commutative40.0%
*-commutative40.0%
swap-sqr40.0%
pow240.0%
times-frac40.5%
*-inverses40.5%
*-un-lft-identity40.5%
div-inv40.4%
metadata-eval40.4%
metadata-eval40.4%
Applied egg-rr40.4%
*-commutative40.4%
metadata-eval40.4%
unpow240.4%
associate-*l/40.4%
metadata-eval40.4%
div-inv40.5%
clear-num40.5%
associate-/r*40.5%
associate-*l/40.5%
metadata-eval40.5%
div-inv40.5%
clear-num40.5%
associate-/r*40.4%
swap-sqr40.4%
div-inv40.5%
div-inv40.5%
sqrt-unprod51.1%
add-sqr-sqrt82.1%
associate-/r*84.0%
Applied egg-rr84.1%
Final simplification88.8%
(FPCore (a b c)
:precision binary64
(if (<= b -1.8e-121)
(/ (* b (- (/ 2.0 a) (* (/ c (pow b 2.0)) 1.5))) -3.0)
(if (<= b 2.4e-119)
(/ (- (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 <= -1.8e-121) {
tmp = (b * ((2.0 / a) - ((c / pow(b, 2.0)) * 1.5))) / -3.0;
} else if (b <= 2.4e-119) {
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 <= (-1.8d-121)) then
tmp = (b * ((2.0d0 / a) - ((c / (b ** 2.0d0)) * 1.5d0))) / (-3.0d0)
else if (b <= 2.4d-119) 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 <= -1.8e-121) {
tmp = (b * ((2.0 / a) - ((c / Math.pow(b, 2.0)) * 1.5))) / -3.0;
} else if (b <= 2.4e-119) {
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 <= -1.8e-121: tmp = (b * ((2.0 / a) - ((c / math.pow(b, 2.0)) * 1.5))) / -3.0 elif b <= 2.4e-119: 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 <= -1.8e-121) tmp = Float64(Float64(b * Float64(Float64(2.0 / a) - Float64(Float64(c / (b ^ 2.0)) * 1.5))) / -3.0); elseif (b <= 2.4e-119) 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 <= -1.8e-121) tmp = (b * ((2.0 / a) - ((c / (b ^ 2.0)) * 1.5))) / -3.0; elseif (b <= 2.4e-119) 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, -1.8e-121], N[(N[(b * N[(N[(2.0 / a), $MachinePrecision] - N[(N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 2.4e-119], 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 -1.8 \cdot 10^{-121}:\\
\;\;\;\;\frac{b \cdot \left(\frac{2}{a} - \frac{c}{{b}^{2}} \cdot 1.5\right)}{-3}\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-119}:\\
\;\;\;\;\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 < -1.79999999999999992e-121Initial program 72.5%
sqr-neg72.5%
sqr-neg72.5%
associate-*l*72.5%
Simplified72.5%
frac-2neg72.5%
div-inv72.4%
Applied egg-rr72.4%
fma-undefine72.4%
unpow272.4%
associate-*l*72.4%
*-commutative72.4%
+-commutative72.4%
fma-define72.4%
associate-/r*72.4%
Simplified72.4%
associate-*r/72.4%
Applied egg-rr72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in b around -inf 81.0%
associate-*r*81.0%
neg-mul-181.0%
*-commutative81.0%
associate-*r/81.0%
metadata-eval81.0%
Simplified81.0%
if -1.79999999999999992e-121 < b < 2.40000000000000009e-119Initial program 83.3%
sqr-neg83.3%
sqr-neg83.3%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in b around 0 80.3%
*-commutative80.3%
metadata-eval80.3%
distribute-rgt-neg-in80.3%
*-commutative80.3%
associate-*r*80.4%
neg-sub080.4%
*-commutative80.4%
Applied egg-rr80.4%
neg-sub080.4%
*-commutative80.4%
distribute-rgt-neg-in80.4%
distribute-rgt-neg-in80.4%
metadata-eval80.4%
Simplified80.4%
if 2.40000000000000009e-119 < b Initial program 17.9%
sqr-neg17.9%
sqr-neg17.9%
associate-*l*17.9%
Simplified17.9%
Taylor expanded in b around inf 69.5%
associate-/l*69.5%
associate-/l*72.9%
*-commutative72.9%
Applied egg-rr72.9%
add-sqr-sqrt46.3%
sqrt-unprod40.0%
*-commutative40.0%
*-commutative40.0%
swap-sqr40.0%
pow240.0%
times-frac40.5%
*-inverses40.5%
*-un-lft-identity40.5%
div-inv40.4%
metadata-eval40.4%
metadata-eval40.4%
Applied egg-rr40.4%
*-commutative40.4%
metadata-eval40.4%
unpow240.4%
associate-*l/40.4%
metadata-eval40.4%
div-inv40.5%
clear-num40.5%
associate-/r*40.5%
associate-*l/40.5%
metadata-eval40.5%
div-inv40.5%
clear-num40.5%
associate-/r*40.4%
swap-sqr40.4%
div-inv40.5%
div-inv40.5%
sqrt-unprod51.1%
add-sqr-sqrt82.1%
associate-/r*84.0%
Applied egg-rr84.1%
Final simplification82.3%
(FPCore (a b c)
:precision binary64
(if (<= b -1.5e-121)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 2.1e-117)
(/ (- (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 <= -1.5e-121) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.1e-117) {
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 <= (-1.5d-121)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 2.1d-117) 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 <= -1.5e-121) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.1e-117) {
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 <= -1.5e-121: tmp = ((b * 2.0) / a) / -3.0 elif b <= 2.1e-117: 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 <= -1.5e-121) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 2.1e-117) 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 <= -1.5e-121) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 2.1e-117) 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, -1.5e-121], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 2.1e-117], 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 -1.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-117}:\\
\;\;\;\;\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 < -1.5e-121Initial program 72.5%
sqr-neg72.5%
sqr-neg72.5%
associate-*l*72.5%
Simplified72.5%
frac-2neg72.5%
div-inv72.4%
Applied egg-rr72.4%
fma-undefine72.4%
unpow272.4%
associate-*l*72.4%
*-commutative72.4%
+-commutative72.4%
fma-define72.4%
associate-/r*72.4%
Simplified72.4%
associate-*r/72.4%
Applied egg-rr72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in b around -inf 81.0%
*-commutative81.0%
Simplified81.0%
if -1.5e-121 < b < 2.0999999999999999e-117Initial program 83.3%
sqr-neg83.3%
sqr-neg83.3%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in b around 0 80.3%
*-commutative80.3%
metadata-eval80.3%
distribute-rgt-neg-in80.3%
*-commutative80.3%
associate-*r*80.4%
neg-sub080.4%
*-commutative80.4%
Applied egg-rr80.4%
neg-sub080.4%
*-commutative80.4%
distribute-rgt-neg-in80.4%
distribute-rgt-neg-in80.4%
metadata-eval80.4%
Simplified80.4%
if 2.0999999999999999e-117 < b Initial program 17.9%
sqr-neg17.9%
sqr-neg17.9%
associate-*l*17.9%
Simplified17.9%
Taylor expanded in b around inf 69.5%
associate-/l*69.5%
associate-/l*72.9%
*-commutative72.9%
Applied egg-rr72.9%
add-sqr-sqrt46.3%
sqrt-unprod40.0%
*-commutative40.0%
*-commutative40.0%
swap-sqr40.0%
pow240.0%
times-frac40.5%
*-inverses40.5%
*-un-lft-identity40.5%
div-inv40.4%
metadata-eval40.4%
metadata-eval40.4%
Applied egg-rr40.4%
*-commutative40.4%
metadata-eval40.4%
unpow240.4%
associate-*l/40.4%
metadata-eval40.4%
div-inv40.5%
clear-num40.5%
associate-/r*40.5%
associate-*l/40.5%
metadata-eval40.5%
div-inv40.5%
clear-num40.5%
associate-/r*40.4%
swap-sqr40.4%
div-inv40.5%
div-inv40.5%
sqrt-unprod51.1%
add-sqr-sqrt82.1%
associate-/r*84.0%
Applied egg-rr84.1%
Final simplification82.3%
(FPCore (a b c)
:precision binary64
(if (<= b -1.25e-123)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 1.22e-117)
(/ (- (sqrt (* (* 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.25e-123) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.22e-117) {
tmp = (sqrt(((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.25d-123)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 1.22d-117) then
tmp = (sqrt(((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.25e-123) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 1.22e-117) {
tmp = (Math.sqrt(((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.25e-123: tmp = ((b * 2.0) / a) / -3.0 elif b <= 1.22e-117: tmp = (math.sqrt(((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.25e-123) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 1.22e-117) tmp = Float64(Float64(sqrt(Float64(Float64(a * 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.25e-123) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 1.22e-117) tmp = (sqrt(((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.25e-123], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 1.22e-117], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $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.25 \cdot 10^{-123}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 1.22 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.25000000000000007e-123Initial program 72.5%
sqr-neg72.5%
sqr-neg72.5%
associate-*l*72.5%
Simplified72.5%
frac-2neg72.5%
div-inv72.4%
Applied egg-rr72.4%
fma-undefine72.4%
unpow272.4%
associate-*l*72.4%
*-commutative72.4%
+-commutative72.4%
fma-define72.4%
associate-/r*72.4%
Simplified72.4%
associate-*r/72.4%
Applied egg-rr72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in b around -inf 81.0%
*-commutative81.0%
Simplified81.0%
if -1.25000000000000007e-123 < b < 1.21999999999999997e-117Initial program 83.3%
sqr-neg83.3%
sqr-neg83.3%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in b around 0 80.3%
if 1.21999999999999997e-117 < b Initial program 17.9%
sqr-neg17.9%
sqr-neg17.9%
associate-*l*17.9%
Simplified17.9%
Taylor expanded in b around inf 69.5%
associate-/l*69.5%
associate-/l*72.9%
*-commutative72.9%
Applied egg-rr72.9%
add-sqr-sqrt46.3%
sqrt-unprod40.0%
*-commutative40.0%
*-commutative40.0%
swap-sqr40.0%
pow240.0%
times-frac40.5%
*-inverses40.5%
*-un-lft-identity40.5%
div-inv40.4%
metadata-eval40.4%
metadata-eval40.4%
Applied egg-rr40.4%
*-commutative40.4%
metadata-eval40.4%
unpow240.4%
associate-*l/40.4%
metadata-eval40.4%
div-inv40.5%
clear-num40.5%
associate-/r*40.5%
associate-*l/40.5%
metadata-eval40.5%
div-inv40.5%
clear-num40.5%
associate-/r*40.4%
swap-sqr40.4%
div-inv40.5%
div-inv40.5%
sqrt-unprod51.1%
add-sqr-sqrt82.1%
associate-/r*84.0%
Applied egg-rr84.1%
Final simplification82.3%
(FPCore (a b c)
:precision binary64
(if (<= b -2.25e-121)
(/ (/ (* b 2.0) a) -3.0)
(if (<= b 2.1e-117)
(/ (/ (- b (sqrt (* (* a c) -3.0))) a) -3.0)
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.25e-121) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.1e-117) {
tmp = ((b - sqrt(((a * c) * -3.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 <= (-2.25d-121)) then
tmp = ((b * 2.0d0) / a) / (-3.0d0)
else if (b <= 2.1d-117) then
tmp = ((b - sqrt(((a * c) * (-3.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 <= -2.25e-121) {
tmp = ((b * 2.0) / a) / -3.0;
} else if (b <= 2.1e-117) {
tmp = ((b - Math.sqrt(((a * c) * -3.0))) / a) / -3.0;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.25e-121: tmp = ((b * 2.0) / a) / -3.0 elif b <= 2.1e-117: tmp = ((b - math.sqrt(((a * c) * -3.0))) / a) / -3.0 else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.25e-121) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); elseif (b <= 2.1e-117) tmp = Float64(Float64(Float64(b - sqrt(Float64(Float64(a * c) * -3.0))) / 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 <= -2.25e-121) tmp = ((b * 2.0) / a) / -3.0; elseif (b <= 2.1e-117) tmp = ((b - sqrt(((a * c) * -3.0))) / a) / -3.0; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.25e-121], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 2.1e-117], N[(N[(N[(b - N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.25 \cdot 10^{-121}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-117}:\\
\;\;\;\;\frac{\frac{b - \sqrt{\left(a \cdot c\right) \cdot -3}}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.2500000000000002e-121Initial program 72.5%
sqr-neg72.5%
sqr-neg72.5%
associate-*l*72.5%
Simplified72.5%
frac-2neg72.5%
div-inv72.4%
Applied egg-rr72.4%
fma-undefine72.4%
unpow272.4%
associate-*l*72.4%
*-commutative72.4%
+-commutative72.4%
fma-define72.4%
associate-/r*72.4%
Simplified72.4%
associate-*r/72.4%
Applied egg-rr72.4%
associate-*r/72.4%
*-rgt-identity72.4%
*-commutative72.4%
Simplified72.4%
Taylor expanded in b around -inf 81.0%
*-commutative81.0%
Simplified81.0%
if -2.2500000000000002e-121 < b < 2.0999999999999999e-117Initial program 83.3%
sqr-neg83.3%
sqr-neg83.3%
associate-*l*83.1%
Simplified83.1%
frac-2neg83.1%
div-inv83.0%
Applied egg-rr82.9%
fma-undefine82.9%
unpow282.9%
associate-*l*83.0%
*-commutative83.0%
+-commutative83.0%
fma-define83.0%
associate-/r*82.9%
Simplified82.9%
associate-*r/83.0%
Applied egg-rr83.0%
associate-*r/83.1%
*-rgt-identity83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in c around inf 80.2%
if 2.0999999999999999e-117 < b Initial program 17.9%
sqr-neg17.9%
sqr-neg17.9%
associate-*l*17.9%
Simplified17.9%
Taylor expanded in b around inf 69.5%
associate-/l*69.5%
associate-/l*72.9%
*-commutative72.9%
Applied egg-rr72.9%
add-sqr-sqrt46.3%
sqrt-unprod40.0%
*-commutative40.0%
*-commutative40.0%
swap-sqr40.0%
pow240.0%
times-frac40.5%
*-inverses40.5%
*-un-lft-identity40.5%
div-inv40.4%
metadata-eval40.4%
metadata-eval40.4%
Applied egg-rr40.4%
*-commutative40.4%
metadata-eval40.4%
unpow240.4%
associate-*l/40.4%
metadata-eval40.4%
div-inv40.5%
clear-num40.5%
associate-/r*40.5%
associate-*l/40.5%
metadata-eval40.5%
div-inv40.5%
clear-num40.5%
associate-/r*40.4%
swap-sqr40.4%
div-inv40.5%
div-inv40.5%
sqrt-unprod51.1%
add-sqr-sqrt82.1%
associate-/r*84.0%
Applied egg-rr84.1%
Final simplification82.2%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (/ (/ (* b 2.0) a) -3.0) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-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 <= (-2d-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 <= -2e-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 <= -2e-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 <= -2e-310) tmp = Float64(Float64(Float64(b * 2.0) / 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 <= -2e-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, -2e-310], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 75.8%
sqr-neg75.8%
sqr-neg75.8%
associate-*l*75.8%
Simplified75.8%
frac-2neg75.8%
div-inv75.7%
Applied egg-rr75.7%
fma-undefine75.7%
unpow275.7%
associate-*l*75.7%
*-commutative75.7%
+-commutative75.7%
fma-define75.8%
associate-/r*75.7%
Simplified75.7%
associate-*r/75.7%
Applied egg-rr75.7%
associate-*r/75.7%
*-rgt-identity75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in b around -inf 69.1%
*-commutative69.1%
Simplified69.1%
if -1.999999999999994e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.1%
Simplified27.1%
Taylor expanded in b around inf 59.6%
associate-/l*59.6%
associate-/l*63.4%
*-commutative63.4%
Applied egg-rr63.4%
add-sqr-sqrt40.2%
sqrt-unprod34.9%
*-commutative34.9%
*-commutative34.9%
swap-sqr35.0%
pow235.0%
times-frac35.3%
*-inverses35.3%
*-un-lft-identity35.3%
div-inv35.3%
metadata-eval35.3%
metadata-eval35.3%
Applied egg-rr35.3%
*-commutative35.3%
metadata-eval35.3%
unpow235.3%
associate-*l/35.3%
metadata-eval35.3%
div-inv35.3%
clear-num35.3%
associate-/r*35.3%
associate-*l/35.3%
metadata-eval35.3%
div-inv35.3%
clear-num35.3%
associate-/r*35.3%
swap-sqr35.3%
div-inv35.3%
div-inv35.3%
sqrt-unprod44.2%
add-sqr-sqrt71.1%
associate-/r*72.8%
Applied egg-rr72.9%
Final simplification71.1%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (/ (* b -0.6666666666666666) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-310) {
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 <= (-2d-310)) 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 <= -2e-310) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e-310: tmp = (b * -0.6666666666666666) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e-310) 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 <= -2e-310) tmp = (b * -0.6666666666666666) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e-310], 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 -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 75.8%
sqr-neg75.8%
sqr-neg75.8%
associate-*l*75.8%
Simplified75.8%
Taylor expanded in b around -inf 69.0%
*-commutative69.0%
Simplified69.0%
associate-*l/69.1%
Applied egg-rr69.1%
if -1.999999999999994e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.1%
Simplified27.1%
Taylor expanded in b around inf 59.6%
associate-/l*59.6%
associate-/l*63.4%
*-commutative63.4%
Applied egg-rr63.4%
add-sqr-sqrt40.2%
sqrt-unprod34.9%
*-commutative34.9%
*-commutative34.9%
swap-sqr35.0%
pow235.0%
times-frac35.3%
*-inverses35.3%
*-un-lft-identity35.3%
div-inv35.3%
metadata-eval35.3%
metadata-eval35.3%
Applied egg-rr35.3%
*-commutative35.3%
metadata-eval35.3%
unpow235.3%
associate-*l/35.3%
metadata-eval35.3%
div-inv35.3%
clear-num35.3%
associate-/r*35.3%
associate-*l/35.3%
metadata-eval35.3%
div-inv35.3%
clear-num35.3%
associate-/r*35.3%
swap-sqr35.3%
div-inv35.3%
div-inv35.3%
sqrt-unprod44.2%
add-sqr-sqrt71.1%
associate-/r*72.8%
Applied egg-rr72.9%
Final simplification71.1%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (/ b (* a -1.5)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-310) {
tmp = b / (a * -1.5);
} 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 <= (-2d-310)) then
tmp = b / (a * (-1.5d0))
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 <= -2e-310) {
tmp = b / (a * -1.5);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e-310: tmp = b / (a * -1.5) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e-310) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2e-310) tmp = b / (a * -1.5); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e-310], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 75.8%
sqr-neg75.8%
sqr-neg75.8%
associate-*l*75.8%
Simplified75.8%
frac-2neg75.8%
div-inv75.7%
Applied egg-rr75.7%
fma-undefine75.7%
unpow275.7%
associate-*l*75.7%
*-commutative75.7%
+-commutative75.7%
fma-define75.8%
associate-/r*75.7%
Simplified75.7%
Taylor expanded in b around -inf 69.0%
associate-*r/69.1%
*-commutative69.1%
associate-/l*69.0%
Simplified69.0%
clear-num68.9%
un-div-inv69.0%
div-inv69.0%
metadata-eval69.0%
Applied egg-rr69.0%
if -1.999999999999994e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.1%
Simplified27.1%
Taylor expanded in b around inf 59.6%
associate-/l*59.6%
associate-/l*63.4%
*-commutative63.4%
Applied egg-rr63.4%
add-sqr-sqrt40.2%
sqrt-unprod34.9%
*-commutative34.9%
*-commutative34.9%
swap-sqr35.0%
pow235.0%
times-frac35.3%
*-inverses35.3%
*-un-lft-identity35.3%
div-inv35.3%
metadata-eval35.3%
metadata-eval35.3%
Applied egg-rr35.3%
*-commutative35.3%
metadata-eval35.3%
unpow235.3%
associate-*l/35.3%
metadata-eval35.3%
div-inv35.3%
clear-num35.3%
associate-/r*35.3%
associate-*l/35.3%
metadata-eval35.3%
div-inv35.3%
clear-num35.3%
associate-/r*35.3%
swap-sqr35.3%
div-inv35.3%
div-inv35.3%
sqrt-unprod44.2%
add-sqr-sqrt71.1%
associate-/r*72.8%
Applied egg-rr72.9%
Final simplification71.1%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (/ b (* a -1.5)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-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 <= (-2d-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 <= -2e-310) {
tmp = b / (a * -1.5);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e-310: tmp = b / (a * -1.5) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e-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 <= -2e-310) tmp = b / (a * -1.5); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e-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 -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 75.8%
sqr-neg75.8%
sqr-neg75.8%
associate-*l*75.8%
Simplified75.8%
frac-2neg75.8%
div-inv75.7%
Applied egg-rr75.7%
fma-undefine75.7%
unpow275.7%
associate-*l*75.7%
*-commutative75.7%
+-commutative75.7%
fma-define75.8%
associate-/r*75.7%
Simplified75.7%
Taylor expanded in b around -inf 69.0%
associate-*r/69.1%
*-commutative69.1%
associate-/l*69.0%
Simplified69.0%
clear-num68.9%
un-div-inv69.0%
div-inv69.0%
metadata-eval69.0%
Applied egg-rr69.0%
if -1.999999999999994e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.1%
Simplified27.1%
Taylor expanded in b around inf 72.8%
*-commutative72.8%
Simplified72.8%
Final simplification71.1%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (* b (/ -0.6666666666666666 a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-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 <= (-2d-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 <= -2e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e-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 <= -2e-310) tmp = b * (-0.6666666666666666 / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e-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 -2 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 75.8%
sqr-neg75.8%
sqr-neg75.8%
associate-*l*75.8%
Simplified75.8%
frac-2neg75.8%
div-inv75.7%
Applied egg-rr75.7%
fma-undefine75.7%
unpow275.7%
associate-*l*75.7%
*-commutative75.7%
+-commutative75.7%
fma-define75.8%
associate-/r*75.7%
Simplified75.7%
Taylor expanded in b around -inf 69.0%
associate-*r/69.1%
*-commutative69.1%
associate-/l*69.0%
Simplified69.0%
if -1.999999999999994e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.1%
Simplified27.1%
Taylor expanded in b around inf 72.8%
*-commutative72.8%
Simplified72.8%
Final simplification71.1%
(FPCore (a b c) :precision binary64 (if (<= b -2e-310) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2e-310) {
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 <= (-2d-310)) 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 <= -2e-310) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2e-310: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2e-310) 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 <= -2e-310) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2e-310], 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 -2 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < -1.999999999999994e-310Initial program 75.8%
sqr-neg75.8%
sqr-neg75.8%
associate-*l*75.8%
Simplified75.8%
frac-2neg75.8%
div-inv75.7%
Applied egg-rr75.7%
fma-undefine75.7%
unpow275.7%
associate-*l*75.7%
*-commutative75.7%
+-commutative75.7%
fma-define75.8%
associate-/r*75.7%
Simplified75.7%
Taylor expanded in b around -inf 69.0%
associate-*r/69.1%
*-commutative69.1%
associate-/l*69.0%
Simplified69.0%
if -1.999999999999994e-310 < b Initial program 27.2%
sqr-neg27.2%
sqr-neg27.2%
associate-*l*27.1%
Simplified27.1%
Taylor expanded in c around 0 66.3%
Taylor expanded in a around 0 72.6%
(FPCore (a b c) :precision binary64 (if (<= b 2.4e-264) (* b (/ -0.6666666666666666 a)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= 2.4e-264) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = 0.0;
}
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-264) then
tmp = b * ((-0.6666666666666666d0) / a)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 2.4e-264) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 2.4e-264: tmp = b * (-0.6666666666666666 / a) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 2.4e-264) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 2.4e-264) tmp = b * (-0.6666666666666666 / a); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 2.4e-264], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.4 \cdot 10^{-264}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < 2.3999999999999999e-264Initial program 75.9%
sqr-neg75.9%
sqr-neg75.9%
associate-*l*75.9%
Simplified75.9%
frac-2neg75.9%
div-inv75.8%
Applied egg-rr75.7%
fma-undefine75.7%
unpow275.7%
associate-*l*75.8%
*-commutative75.8%
+-commutative75.8%
fma-define75.8%
associate-/r*75.7%
Simplified75.7%
Taylor expanded in b around -inf 66.9%
associate-*r/67.0%
*-commutative67.0%
associate-/l*67.0%
Simplified67.0%
if 2.3999999999999999e-264 < b Initial program 25.6%
add-cube-cbrt25.2%
pow325.3%
Applied egg-rr25.3%
rem-cube-cbrt25.6%
clear-num25.6%
inv-pow25.6%
*-commutative25.6%
neg-mul-125.6%
fma-define25.6%
pow225.6%
*-commutative25.6%
*-commutative25.6%
Applied egg-rr25.6%
unpow-125.6%
Simplified25.6%
Taylor expanded in a around 0 23.6%
associate-*r/23.6%
distribute-rgt1-in23.6%
metadata-eval23.6%
mul0-lft23.6%
metadata-eval23.6%
Simplified23.6%
Taylor expanded in a around 0 23.6%
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
return 0.0;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.0d0
end function
public static double code(double a, double b, double c) {
return 0.0;
}
def code(a, b, c): return 0.0
function code(a, b, c) return 0.0 end
function tmp = code(a, b, c) tmp = 0.0; end
code[a_, b_, c_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 49.8%
add-cube-cbrt49.1%
pow349.1%
Applied egg-rr49.1%
rem-cube-cbrt49.8%
clear-num49.8%
inv-pow49.8%
*-commutative49.8%
neg-mul-149.8%
fma-define49.8%
pow249.8%
*-commutative49.8%
*-commutative49.8%
Applied egg-rr49.8%
unpow-149.8%
Simplified49.8%
Taylor expanded in a around 0 13.5%
associate-*r/13.5%
distribute-rgt1-in13.5%
metadata-eval13.5%
mul0-lft13.5%
metadata-eval13.5%
Simplified13.5%
Taylor expanded in a around 0 13.5%
herbie shell --seed 2024165
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))