
(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 15 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 -3.8e+89)
(/ (/ b a) -1.5)
(if (<= b 9.5e-44)
(/ (- (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 <= -3.8e+89) {
tmp = (b / a) / -1.5;
} else if (b <= 9.5e-44) {
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 <= (-3.8d+89)) then
tmp = (b / a) / (-1.5d0)
else if (b <= 9.5d-44) 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 <= -3.8e+89) {
tmp = (b / a) / -1.5;
} else if (b <= 9.5e-44) {
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 <= -3.8e+89: tmp = (b / a) / -1.5 elif b <= 9.5e-44: 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 <= -3.8e+89) tmp = Float64(Float64(b / a) / -1.5); elseif (b <= 9.5e-44) 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 <= -3.8e+89) tmp = (b / a) / -1.5; elseif (b <= 9.5e-44) 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, -3.8e+89], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], If[LessEqual[b, 9.5e-44], 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 -3.8 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-44}:\\
\;\;\;\;\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 < -3.80000000000000023e89Initial program 46.3%
sqr-neg46.3%
sqr-neg46.3%
associate-*l*46.3%
Simplified46.3%
Taylor expanded in b around -inf 93.8%
*-commutative93.8%
Simplified93.8%
associate-*l/93.9%
clear-num93.8%
Applied egg-rr93.8%
associate-/r/93.7%
Simplified93.7%
associate-*r*93.8%
associate-*l/93.8%
*-un-lft-identity93.8%
metadata-eval93.8%
div-inv93.9%
Applied egg-rr93.9%
if -3.80000000000000023e89 < b < 9.49999999999999924e-44Initial program 83.5%
if 9.49999999999999924e-44 < b Initial program 16.0%
sqr-neg16.0%
sqr-neg16.0%
associate-*l*16.0%
Simplified16.0%
Applied egg-rr27.0%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt91.9%
Simplified91.9%
Taylor expanded in c around 0 92.1%
*-commutative92.1%
Simplified92.1%
Final simplification89.4%
(FPCore (a b c)
:precision binary64
(if (<= b -2.5e+88)
(/ (/ b a) -1.5)
(if (<= b 1.45e-43)
(/ (- (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 <= -2.5e+88) {
tmp = (b / a) / -1.5;
} else if (b <= 1.45e-43) {
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 <= (-2.5d+88)) then
tmp = (b / a) / (-1.5d0)
else if (b <= 1.45d-43) 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 <= -2.5e+88) {
tmp = (b / a) / -1.5;
} else if (b <= 1.45e-43) {
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 <= -2.5e+88: tmp = (b / a) / -1.5 elif b <= 1.45e-43: 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 <= -2.5e+88) tmp = Float64(Float64(b / a) / -1.5); elseif (b <= 1.45e-43) 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 <= -2.5e+88) tmp = (b / a) / -1.5; elseif (b <= 1.45e-43) 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, -2.5e+88], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], If[LessEqual[b, 1.45e-43], 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 -2.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{-43}:\\
\;\;\;\;\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 < -2.49999999999999999e88Initial program 46.3%
sqr-neg46.3%
sqr-neg46.3%
associate-*l*46.3%
Simplified46.3%
Taylor expanded in b around -inf 93.8%
*-commutative93.8%
Simplified93.8%
associate-*l/93.9%
clear-num93.8%
Applied egg-rr93.8%
associate-/r/93.7%
Simplified93.7%
associate-*r*93.8%
associate-*l/93.8%
*-un-lft-identity93.8%
metadata-eval93.8%
div-inv93.9%
Applied egg-rr93.9%
if -2.49999999999999999e88 < b < 1.4500000000000001e-43Initial program 83.5%
sqr-neg83.5%
sqr-neg83.5%
associate-*l*83.5%
Simplified83.5%
if 1.4500000000000001e-43 < b Initial program 16.0%
sqr-neg16.0%
sqr-neg16.0%
associate-*l*16.0%
Simplified16.0%
Applied egg-rr27.0%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt91.9%
Simplified91.9%
Taylor expanded in c around 0 92.1%
*-commutative92.1%
Simplified92.1%
Final simplification89.3%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-92)
(/ (* b -0.6666666666666666) a)
(if (<= b 1.32e-68)
(/ (- (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 <= -8.2e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 1.32e-68) {
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 <= (-8.2d-92)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 1.32d-68) 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 <= -8.2e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 1.32e-68) {
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 <= -8.2e-92: tmp = (b * -0.6666666666666666) / a elif b <= 1.32e-68: 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 <= -8.2e-92) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 1.32e-68) 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 <= -8.2e-92) tmp = (b * -0.6666666666666666) / a; elseif (b <= 1.32e-68) 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, -8.2e-92], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.32e-68], 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 -8.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 1.32 \cdot 10^{-68}:\\
\;\;\;\;\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 < -8.2000000000000005e-92Initial program 64.5%
sqr-neg64.5%
sqr-neg64.5%
associate-*l*64.5%
Simplified64.5%
Taylor expanded in b around -inf 85.7%
*-commutative85.7%
Simplified85.7%
associate-*l/85.8%
Applied egg-rr85.8%
if -8.2000000000000005e-92 < b < 1.32e-68Initial program 76.2%
sqr-neg76.2%
sqr-neg76.2%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in b around 0 76.0%
*-commutative76.0%
*-commutative76.0%
associate-*r*76.0%
Simplified76.0%
if 1.32e-68 < b Initial program 17.4%
sqr-neg17.4%
sqr-neg17.4%
associate-*l*17.4%
Simplified17.4%
Applied egg-rr27.2%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.5%
Simplified90.5%
Taylor expanded in c around 0 90.8%
*-commutative90.8%
Simplified90.8%
Final simplification85.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5.9e-91)
(/ (* b -0.6666666666666666) a)
(if (<= b 5.8e-65)
(/ (- (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 <= -5.9e-91) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 5.8e-65) {
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 <= (-5.9d-91)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 5.8d-65) 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 <= -5.9e-91) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 5.8e-65) {
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 <= -5.9e-91: tmp = (b * -0.6666666666666666) / a elif b <= 5.8e-65: 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 <= -5.9e-91) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 5.8e-65) 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 <= -5.9e-91) tmp = (b * -0.6666666666666666) / a; elseif (b <= 5.8e-65) 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, -5.9e-91], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 5.8e-65], 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 -5.9 \cdot 10^{-91}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 5.8 \cdot 10^{-65}:\\
\;\;\;\;\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 < -5.90000000000000025e-91Initial program 64.5%
sqr-neg64.5%
sqr-neg64.5%
associate-*l*64.5%
Simplified64.5%
Taylor expanded in b around -inf 85.7%
*-commutative85.7%
Simplified85.7%
associate-*l/85.8%
Applied egg-rr85.8%
if -5.90000000000000025e-91 < b < 5.7999999999999996e-65Initial program 76.2%
sqr-neg76.2%
sqr-neg76.2%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in b around 0 76.0%
if 5.7999999999999996e-65 < b Initial program 17.4%
sqr-neg17.4%
sqr-neg17.4%
associate-*l*17.4%
Simplified17.4%
Applied egg-rr27.2%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.5%
Simplified90.5%
Taylor expanded in c around 0 90.8%
*-commutative90.8%
Simplified90.8%
Final simplification85.5%
(FPCore (a b c)
:precision binary64
(if (<= b -1.9e-90)
(/ (* b -0.6666666666666666) a)
(if (<= b 1.35e-65)
(/ (/ (+ b (sqrt (* c (* a -3.0)))) 3.0) a)
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-90) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 1.35e-65) {
tmp = ((b + sqrt((c * (a * -3.0)))) / 3.0) / 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.9d-90)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 1.35d-65) then
tmp = ((b + sqrt((c * (a * (-3.0d0))))) / 3.0d0) / 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.9e-90) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 1.35e-65) {
tmp = ((b + Math.sqrt((c * (a * -3.0)))) / 3.0) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.9e-90: tmp = (b * -0.6666666666666666) / a elif b <= 1.35e-65: tmp = ((b + math.sqrt((c * (a * -3.0)))) / 3.0) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.9e-90) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 1.35e-65) tmp = Float64(Float64(Float64(b + sqrt(Float64(c * Float64(a * -3.0)))) / 3.0) / 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.9e-90) tmp = (b * -0.6666666666666666) / a; elseif (b <= 1.35e-65) tmp = ((b + sqrt((c * (a * -3.0)))) / 3.0) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.9e-90], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.35e-65], N[(N[(N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-90}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 1.35 \cdot 10^{-65}:\\
\;\;\;\;\frac{\frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{3}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.9e-90Initial program 64.5%
sqr-neg64.5%
sqr-neg64.5%
associate-*l*64.5%
Simplified64.5%
Taylor expanded in b around -inf 85.7%
*-commutative85.7%
Simplified85.7%
associate-*l/85.8%
Applied egg-rr85.8%
if -1.9e-90 < b < 1.3499999999999999e-65Initial program 76.2%
sqr-neg76.2%
sqr-neg76.2%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in b around 0 76.0%
*-commutative76.0%
*-commutative76.0%
associate-*r*76.0%
Simplified76.0%
clear-num76.0%
inv-pow76.0%
*-un-lft-identity76.0%
times-frac75.7%
metadata-eval75.7%
add-sqr-sqrt43.9%
sqrt-unprod74.8%
sqr-neg74.8%
sqrt-unprod31.3%
add-sqr-sqrt74.9%
Applied egg-rr74.9%
unpow-174.9%
associate-*r/75.2%
*-commutative75.2%
Simplified75.2%
clear-num75.2%
*-un-lft-identity75.2%
times-frac75.0%
*-commutative75.0%
associate-*r*74.9%
*-commutative74.9%
Applied egg-rr74.9%
associate-*l/75.3%
*-lft-identity75.3%
associate-*r*75.2%
*-commutative75.2%
associate-*l*75.2%
Simplified75.2%
if 1.3499999999999999e-65 < b Initial program 17.4%
sqr-neg17.4%
sqr-neg17.4%
associate-*l*17.4%
Simplified17.4%
Applied egg-rr27.2%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.5%
Simplified90.5%
Taylor expanded in c around 0 90.8%
*-commutative90.8%
Simplified90.8%
(FPCore (a b c)
:precision binary64
(if (<= b -9e-92)
(/ (* b -0.6666666666666666) a)
(if (<= b 3.8e-65)
(/ (+ b (sqrt (* c (* a -3.0)))) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -9e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 3.8e-65) {
tmp = (b + sqrt((c * (a * -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 <= (-9d-92)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 3.8d-65) then
tmp = (b + sqrt((c * (a * (-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 <= -9e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 3.8e-65) {
tmp = (b + Math.sqrt((c * (a * -3.0)))) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -9e-92: tmp = (b * -0.6666666666666666) / a elif b <= 3.8e-65: tmp = (b + math.sqrt((c * (a * -3.0)))) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -9e-92) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 3.8e-65) tmp = Float64(Float64(b + sqrt(Float64(c * Float64(a * -3.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 <= -9e-92) tmp = (b * -0.6666666666666666) / a; elseif (b <= 3.8e-65) tmp = (b + sqrt((c * (a * -3.0)))) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -9e-92], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 3.8e-65], N[(N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -9 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-65}:\\
\;\;\;\;\frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -9.0000000000000001e-92Initial program 64.5%
sqr-neg64.5%
sqr-neg64.5%
associate-*l*64.5%
Simplified64.5%
Taylor expanded in b around -inf 85.7%
*-commutative85.7%
Simplified85.7%
associate-*l/85.8%
Applied egg-rr85.8%
if -9.0000000000000001e-92 < b < 3.8000000000000002e-65Initial program 76.2%
sqr-neg76.2%
sqr-neg76.2%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in b around 0 76.0%
*-commutative76.0%
*-commutative76.0%
associate-*r*76.0%
Simplified76.0%
*-un-lft-identity76.0%
add-sqr-sqrt44.1%
sqrt-unprod75.1%
sqr-neg75.1%
sqrt-unprod31.4%
add-sqr-sqrt75.2%
*-commutative75.2%
Applied egg-rr75.2%
*-lft-identity75.2%
Simplified75.2%
if 3.8000000000000002e-65 < b Initial program 17.4%
sqr-neg17.4%
sqr-neg17.4%
associate-*l*17.4%
Simplified17.4%
Applied egg-rr27.2%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.5%
Simplified90.5%
Taylor expanded in c around 0 90.8%
*-commutative90.8%
Simplified90.8%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-92)
(/ (* b -0.6666666666666666) a)
(if (<= b 8.2e-66)
(* (/ 0.3333333333333333 a) (+ b (sqrt (* a (* c -3.0)))))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 8.2e-66) {
tmp = (0.3333333333333333 / a) * (b + sqrt((a * (c * -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 <= (-8.2d-92)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 8.2d-66) then
tmp = (0.3333333333333333d0 / a) * (b + sqrt((a * (c * (-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 <= -8.2e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 8.2e-66) {
tmp = (0.3333333333333333 / a) * (b + Math.sqrt((a * (c * -3.0))));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-92: tmp = (b * -0.6666666666666666) / a elif b <= 8.2e-66: tmp = (0.3333333333333333 / a) * (b + math.sqrt((a * (c * -3.0)))) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-92) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 8.2e-66) tmp = Float64(Float64(0.3333333333333333 / a) * Float64(b + sqrt(Float64(a * Float64(c * -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 <= -8.2e-92) tmp = (b * -0.6666666666666666) / a; elseif (b <= 8.2e-66) tmp = (0.3333333333333333 / a) * (b + sqrt((a * (c * -3.0)))); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-92], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 8.2e-66], N[(N[(0.3333333333333333 / a), $MachinePrecision] * N[(b + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-66}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(b + \sqrt{a \cdot \left(c \cdot -3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -8.2000000000000005e-92Initial program 64.5%
sqr-neg64.5%
sqr-neg64.5%
associate-*l*64.5%
Simplified64.5%
Taylor expanded in b around -inf 85.7%
*-commutative85.7%
Simplified85.7%
associate-*l/85.8%
Applied egg-rr85.8%
if -8.2000000000000005e-92 < b < 8.19999999999999996e-66Initial program 76.2%
sqr-neg76.2%
sqr-neg76.2%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in b around 0 76.0%
*-commutative76.0%
*-commutative76.0%
associate-*r*76.0%
Simplified76.0%
clear-num76.0%
inv-pow76.0%
*-un-lft-identity76.0%
times-frac75.7%
metadata-eval75.7%
add-sqr-sqrt43.9%
sqrt-unprod74.8%
sqr-neg74.8%
sqrt-unprod31.3%
add-sqr-sqrt74.9%
Applied egg-rr74.9%
unpow-174.9%
associate-*r/75.2%
*-commutative75.2%
Simplified75.2%
associate-/r/75.1%
*-un-lft-identity75.1%
*-commutative75.1%
associate-/r*75.0%
metadata-eval75.0%
*-un-lft-identity75.0%
*-commutative75.0%
associate-*r*75.1%
*-commutative75.1%
Applied egg-rr75.1%
if 8.19999999999999996e-66 < b Initial program 17.4%
sqr-neg17.4%
sqr-neg17.4%
associate-*l*17.4%
Simplified17.4%
Applied egg-rr27.2%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.5%
Simplified90.5%
Taylor expanded in c around 0 90.8%
*-commutative90.8%
Simplified90.8%
(FPCore (a b c)
:precision binary64
(if (<= b -8.2e-92)
(/ (* b -0.6666666666666666) a)
(if (<= b 2.7e-66)
(* 0.3333333333333333 (/ (+ b (sqrt (* a (* c -3.0)))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.2e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2.7e-66) {
tmp = 0.3333333333333333 * ((b + sqrt((a * (c * -3.0)))) / 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 <= (-8.2d-92)) then
tmp = (b * (-0.6666666666666666d0)) / a
else if (b <= 2.7d-66) then
tmp = 0.3333333333333333d0 * ((b + sqrt((a * (c * (-3.0d0))))) / 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 <= -8.2e-92) {
tmp = (b * -0.6666666666666666) / a;
} else if (b <= 2.7e-66) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((a * (c * -3.0)))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.2e-92: tmp = (b * -0.6666666666666666) / a elif b <= 2.7e-66: tmp = 0.3333333333333333 * ((b + math.sqrt((a * (c * -3.0)))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.2e-92) tmp = Float64(Float64(b * -0.6666666666666666) / a); elseif (b <= 2.7e-66) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(a * Float64(c * -3.0)))) / 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 <= -8.2e-92) tmp = (b * -0.6666666666666666) / a; elseif (b <= 2.7e-66) tmp = 0.3333333333333333 * ((b + sqrt((a * (c * -3.0)))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.2e-92], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 2.7e-66], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(a * N[(c * -3.0), $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 -8.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{-66}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -8.2000000000000005e-92Initial program 64.5%
sqr-neg64.5%
sqr-neg64.5%
associate-*l*64.5%
Simplified64.5%
Taylor expanded in b around -inf 85.7%
*-commutative85.7%
Simplified85.7%
associate-*l/85.8%
Applied egg-rr85.8%
if -8.2000000000000005e-92 < b < 2.69999999999999996e-66Initial program 76.2%
sqr-neg76.2%
sqr-neg76.2%
associate-*l*76.1%
Simplified76.1%
Taylor expanded in b around 0 76.0%
*-commutative76.0%
*-commutative76.0%
associate-*r*76.0%
Simplified76.0%
clear-num76.0%
inv-pow76.0%
*-un-lft-identity76.0%
times-frac75.7%
metadata-eval75.7%
add-sqr-sqrt43.9%
sqrt-unprod74.8%
sqr-neg74.8%
sqrt-unprod31.3%
add-sqr-sqrt74.9%
Applied egg-rr74.9%
unpow-174.9%
associate-*r/75.2%
*-commutative75.2%
Simplified75.2%
associate-/r/75.1%
distribute-lft-in75.1%
*-commutative75.1%
associate-/r*75.1%
metadata-eval75.1%
*-commutative75.1%
associate-/r*75.0%
metadata-eval75.0%
*-commutative75.0%
associate-*r*75.1%
*-commutative75.1%
Applied egg-rr75.1%
distribute-lft-in75.1%
associate-*l/75.2%
associate-*r/75.1%
Simplified75.1%
if 2.69999999999999996e-66 < b Initial program 17.4%
sqr-neg17.4%
sqr-neg17.4%
associate-*l*17.4%
Simplified17.4%
Applied egg-rr27.2%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.5%
Simplified90.5%
Taylor expanded in c around 0 90.8%
*-commutative90.8%
Simplified90.8%
(FPCore (a b c) :precision binary64 (if (<= b 3e-223) (/ (* b -0.6666666666666666) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
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 <= 3d-223) 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 <= 3e-223) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3e-223: tmp = (b * -0.6666666666666666) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3e-223) 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 <= 3e-223) tmp = (b * -0.6666666666666666) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3e-223], 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 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 2.99999999999999991e-223Initial program 70.3%
sqr-neg70.3%
sqr-neg70.3%
associate-*l*70.3%
Simplified70.3%
Taylor expanded in b around -inf 66.3%
*-commutative66.3%
Simplified66.3%
associate-*l/66.3%
Applied egg-rr66.3%
if 2.99999999999999991e-223 < b Initial program 25.7%
sqr-neg25.7%
sqr-neg25.7%
associate-*l*25.7%
Simplified25.7%
Applied egg-rr33.5%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt79.9%
Simplified79.9%
Taylor expanded in c around 0 80.1%
*-commutative80.1%
Simplified80.1%
(FPCore (a b c) :precision binary64 (if (<= b 3e-223) (/ (* b -0.6666666666666666) a) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
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 <= 3d-223) 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 <= 3e-223) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3e-223: tmp = (b * -0.6666666666666666) / a else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3e-223) 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 <= 3e-223) tmp = (b * -0.6666666666666666) / a; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3e-223], 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 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 2.99999999999999991e-223Initial program 70.3%
sqr-neg70.3%
sqr-neg70.3%
associate-*l*70.3%
Simplified70.3%
Taylor expanded in b around -inf 66.3%
*-commutative66.3%
Simplified66.3%
associate-*l/66.3%
Applied egg-rr66.3%
if 2.99999999999999991e-223 < b Initial program 25.7%
sqr-neg25.7%
sqr-neg25.7%
associate-*l*25.7%
Simplified25.7%
Taylor expanded in b around inf 80.1%
*-commutative80.1%
Simplified80.1%
Final simplification73.0%
(FPCore (a b c) :precision binary64 (if (<= b 3e-223) (/ b (* a -1.5)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
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 <= 3d-223) 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 <= 3e-223) {
tmp = b / (a * -1.5);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3e-223: tmp = b / (a * -1.5) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3e-223) 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 <= 3e-223) tmp = b / (a * -1.5); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3e-223], 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 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 2.99999999999999991e-223Initial program 70.3%
sqr-neg70.3%
sqr-neg70.3%
associate-*l*70.3%
Simplified70.3%
Applied egg-rr66.7%
Taylor expanded in b around -inf 66.3%
*-commutative66.3%
associate-*l/66.3%
associate-/l*66.2%
Simplified66.2%
clear-num66.2%
un-div-inv66.3%
div-inv66.3%
metadata-eval66.3%
Applied egg-rr66.3%
if 2.99999999999999991e-223 < b Initial program 25.7%
sqr-neg25.7%
sqr-neg25.7%
associate-*l*25.7%
Simplified25.7%
Taylor expanded in b around inf 80.1%
*-commutative80.1%
Simplified80.1%
Final simplification72.9%
(FPCore (a b c) :precision binary64 (if (<= b 3e-223) (* (/ b a) -0.6666666666666666) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3d-223) then
tmp = (b / a) * (-0.6666666666666666d0)
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3e-223: tmp = (b / a) * -0.6666666666666666 else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3e-223) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3e-223) tmp = (b / a) * -0.6666666666666666; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3e-223], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 2.99999999999999991e-223Initial program 70.3%
sqr-neg70.3%
sqr-neg70.3%
associate-*l*70.3%
Simplified70.3%
Taylor expanded in b around -inf 66.3%
*-commutative66.3%
Simplified66.3%
if 2.99999999999999991e-223 < b Initial program 25.7%
sqr-neg25.7%
sqr-neg25.7%
associate-*l*25.7%
Simplified25.7%
Taylor expanded in b around inf 80.1%
*-commutative80.1%
Simplified80.1%
Final simplification72.9%
(FPCore (a b c) :precision binary64 (if (<= b 3e-223) (* (/ b a) -0.6666666666666666) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 3d-223) then
tmp = (b / a) * (-0.6666666666666666d0)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3e-223: tmp = (b / a) * -0.6666666666666666 else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3e-223) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 3e-223) tmp = (b / a) * -0.6666666666666666; else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3e-223], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 2.99999999999999991e-223Initial program 70.3%
sqr-neg70.3%
sqr-neg70.3%
associate-*l*70.3%
Simplified70.3%
Taylor expanded in b around -inf 66.3%
*-commutative66.3%
Simplified66.3%
if 2.99999999999999991e-223 < b Initial program 25.7%
sqr-neg25.7%
sqr-neg25.7%
associate-*l*25.7%
Simplified25.7%
Applied egg-rr33.5%
un-div-inv33.5%
div-inv33.6%
metadata-eval33.6%
Applied egg-rr33.6%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt79.9%
metadata-eval79.9%
Simplified79.9%
(FPCore (a b c) :precision binary64 (if (<= b 3e-223) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3e-223) {
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 <= 3d-223) 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 <= 3e-223) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3e-223: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3e-223) 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 <= 3e-223) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3e-223], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 2.99999999999999991e-223Initial program 70.3%
sqr-neg70.3%
sqr-neg70.3%
associate-*l*70.3%
Simplified70.3%
Applied egg-rr66.7%
Taylor expanded in b around -inf 66.3%
*-commutative66.3%
associate-*l/66.3%
associate-/l*66.2%
Simplified66.2%
if 2.99999999999999991e-223 < b Initial program 25.7%
sqr-neg25.7%
sqr-neg25.7%
associate-*l*25.7%
Simplified25.7%
Applied egg-rr33.5%
un-div-inv33.5%
div-inv33.6%
metadata-eval33.6%
Applied egg-rr33.6%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
associate-*r*0.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt79.9%
metadata-eval79.9%
Simplified79.9%
(FPCore (a b c) :precision binary64 (* b (/ -0.6666666666666666 a)))
double code(double a, double b, double c) {
return b * (-0.6666666666666666 / a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b * ((-0.6666666666666666d0) / a)
end function
public static double code(double a, double b, double c) {
return b * (-0.6666666666666666 / a);
}
def code(a, b, c): return b * (-0.6666666666666666 / a)
function code(a, b, c) return Float64(b * Float64(-0.6666666666666666 / a)) end
function tmp = code(a, b, c) tmp = b * (-0.6666666666666666 / a); end
code[a_, b_, c_] := N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Initial program 48.9%
sqr-neg48.9%
sqr-neg48.9%
associate-*l*48.9%
Simplified48.9%
Applied egg-rr50.7%
Taylor expanded in b around -inf 35.7%
*-commutative35.7%
associate-*l/35.7%
associate-/l*35.7%
Simplified35.7%
herbie shell --seed 2024103
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))