
(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 -3.2e-15)
(/ (/ 1.0 a) (/ -1.5 b))
(if (<= b 0.102)
(/ (- (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.2e-15) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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.2d-15)) then
tmp = (1.0d0 / a) / ((-1.5d0) / b)
else if (b <= 0.102d0) 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.2e-15) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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.2e-15: tmp = (1.0 / a) / (-1.5 / b) elif b <= 0.102: 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.2e-15) tmp = Float64(Float64(1.0 / a) / Float64(-1.5 / b)); elseif (b <= 0.102) 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.2e-15) tmp = (1.0 / a) / (-1.5 / b); elseif (b <= 0.102) 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.2e-15], N[(N[(1.0 / a), $MachinePrecision] / N[(-1.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.102], 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.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{1}{a}}{\frac{-1.5}{b}}\\
\mathbf{elif}\;b \leq 0.102:\\
\;\;\;\;\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.1999999999999999e-15Initial program 68.6%
sqr-neg68.6%
sqr-neg68.6%
associate-*l*68.6%
Simplified68.6%
Applied egg-rr53.4%
Taylor expanded in b around -inf 93.6%
*-commutative93.6%
associate-*l/93.5%
associate-/l*93.5%
Simplified93.5%
associate-*r/93.5%
metadata-eval93.5%
associate-/l*93.7%
un-div-inv93.6%
*-commutative93.6%
clear-num93.6%
un-div-inv93.7%
*-commutative93.7%
associate-/r*93.7%
metadata-eval93.7%
Applied egg-rr93.7%
if -3.1999999999999999e-15 < b < 0.101999999999999993Initial program 80.7%
if 0.101999999999999993 < b Initial program 14.4%
sqr-neg14.4%
sqr-neg14.4%
associate-*l*14.4%
Simplified14.4%
Applied egg-rr19.6%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.8%
Simplified90.8%
Taylor expanded in c around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification88.0%
(FPCore (a b c)
:precision binary64
(if (<= b -3.2e-15)
(/ (/ 1.0 a) (/ -1.5 b))
(if (<= b 0.27)
(/ (- (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 <= -3.2e-15) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.27) {
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 <= (-3.2d-15)) then
tmp = (1.0d0 / a) / ((-1.5d0) / b)
else if (b <= 0.27d0) 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 <= -3.2e-15) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.27) {
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 <= -3.2e-15: tmp = (1.0 / a) / (-1.5 / b) elif b <= 0.27: 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 <= -3.2e-15) tmp = Float64(Float64(1.0 / a) / Float64(-1.5 / b)); elseif (b <= 0.27) 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 <= -3.2e-15) tmp = (1.0 / a) / (-1.5 / b); elseif (b <= 0.27) 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, -3.2e-15], N[(N[(1.0 / a), $MachinePrecision] / N[(-1.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.27], 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.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{1}{a}}{\frac{-1.5}{b}}\\
\mathbf{elif}\;b \leq 0.27:\\
\;\;\;\;\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.1999999999999999e-15Initial program 68.6%
sqr-neg68.6%
sqr-neg68.6%
associate-*l*68.6%
Simplified68.6%
Applied egg-rr53.4%
Taylor expanded in b around -inf 93.6%
*-commutative93.6%
associate-*l/93.5%
associate-/l*93.5%
Simplified93.5%
associate-*r/93.5%
metadata-eval93.5%
associate-/l*93.7%
un-div-inv93.6%
*-commutative93.6%
clear-num93.6%
un-div-inv93.7%
*-commutative93.7%
associate-/r*93.7%
metadata-eval93.7%
Applied egg-rr93.7%
if -3.1999999999999999e-15 < b < 0.27000000000000002Initial program 80.7%
sqr-neg80.7%
sqr-neg80.7%
associate-*l*80.6%
Simplified80.6%
if 0.27000000000000002 < b Initial program 14.4%
sqr-neg14.4%
sqr-neg14.4%
associate-*l*14.4%
Simplified14.4%
Applied egg-rr19.6%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.8%
Simplified90.8%
Taylor expanded in c around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification88.0%
(FPCore (a b c)
:precision binary64
(if (<= b -9.5e-104)
(/ (/ 1.0 a) (/ -1.5 b))
(if (<= b 0.102)
(/ (- (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 <= -9.5e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= (-9.5d-104)) then
tmp = (1.0d0 / a) / ((-1.5d0) / b)
else if (b <= 0.102d0) 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 <= -9.5e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= -9.5e-104: tmp = (1.0 / a) / (-1.5 / b) elif b <= 0.102: 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 <= -9.5e-104) tmp = Float64(Float64(1.0 / a) / Float64(-1.5 / b)); elseif (b <= 0.102) 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 <= -9.5e-104) tmp = (1.0 / a) / (-1.5 / b); elseif (b <= 0.102) 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, -9.5e-104], N[(N[(1.0 / a), $MachinePrecision] / N[(-1.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.102], 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 -9.5 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{1}{a}}{\frac{-1.5}{b}}\\
\mathbf{elif}\;b \leq 0.102:\\
\;\;\;\;\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 < -9.5000000000000002e-104Initial program 73.3%
sqr-neg73.3%
sqr-neg73.3%
associate-*l*73.3%
Simplified73.3%
Applied egg-rr58.2%
Taylor expanded in b around -inf 88.3%
*-commutative88.3%
associate-*l/88.3%
associate-/l*88.2%
Simplified88.2%
associate-*r/88.3%
metadata-eval88.3%
associate-/l*88.4%
un-div-inv88.3%
*-commutative88.3%
clear-num88.3%
un-div-inv88.4%
*-commutative88.4%
associate-/r*88.4%
metadata-eval88.4%
Applied egg-rr88.4%
if -9.5000000000000002e-104 < b < 0.101999999999999993Initial program 78.0%
sqr-neg78.0%
sqr-neg78.0%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in b around 0 73.3%
*-commutative73.3%
*-commutative73.3%
associate-*r*73.4%
Simplified73.4%
if 0.101999999999999993 < b Initial program 14.4%
sqr-neg14.4%
sqr-neg14.4%
associate-*l*14.4%
Simplified14.4%
Applied egg-rr19.6%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.8%
Simplified90.8%
Taylor expanded in c around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification84.9%
(FPCore (a b c)
:precision binary64
(if (<= b -9e-104)
(/ (/ 1.0 a) (/ -1.5 b))
(if (<= b 0.102)
(/ (- (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 <= -9e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= (-9d-104)) then
tmp = (1.0d0 / a) / ((-1.5d0) / b)
else if (b <= 0.102d0) 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 <= -9e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= -9e-104: tmp = (1.0 / a) / (-1.5 / b) elif b <= 0.102: 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 <= -9e-104) tmp = Float64(Float64(1.0 / a) / Float64(-1.5 / b)); elseif (b <= 0.102) 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 <= -9e-104) tmp = (1.0 / a) / (-1.5 / b); elseif (b <= 0.102) 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, -9e-104], N[(N[(1.0 / a), $MachinePrecision] / N[(-1.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.102], 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 -9 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{1}{a}}{\frac{-1.5}{b}}\\
\mathbf{elif}\;b \leq 0.102:\\
\;\;\;\;\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 < -8.9999999999999995e-104Initial program 73.3%
sqr-neg73.3%
sqr-neg73.3%
associate-*l*73.3%
Simplified73.3%
Applied egg-rr58.2%
Taylor expanded in b around -inf 88.3%
*-commutative88.3%
associate-*l/88.3%
associate-/l*88.2%
Simplified88.2%
associate-*r/88.3%
metadata-eval88.3%
associate-/l*88.4%
un-div-inv88.3%
*-commutative88.3%
clear-num88.3%
un-div-inv88.4%
*-commutative88.4%
associate-/r*88.4%
metadata-eval88.4%
Applied egg-rr88.4%
if -8.9999999999999995e-104 < b < 0.101999999999999993Initial program 78.0%
sqr-neg78.0%
sqr-neg78.0%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in b around 0 73.3%
if 0.101999999999999993 < b Initial program 14.4%
sqr-neg14.4%
sqr-neg14.4%
associate-*l*14.4%
Simplified14.4%
Applied egg-rr19.6%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.8%
Simplified90.8%
Taylor expanded in c around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification84.9%
(FPCore (a b c)
:precision binary64
(if (<= b -8.5e-104)
(/ (/ 1.0 a) (/ -1.5 b))
(if (<= b 0.102)
(/ (+ 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 <= -8.5e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= (-8.5d-104)) then
tmp = (1.0d0 / a) / ((-1.5d0) / b)
else if (b <= 0.102d0) 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 <= -8.5e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= -8.5e-104: tmp = (1.0 / a) / (-1.5 / b) elif b <= 0.102: 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 <= -8.5e-104) tmp = Float64(Float64(1.0 / a) / Float64(-1.5 / b)); elseif (b <= 0.102) 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 <= -8.5e-104) tmp = (1.0 / a) / (-1.5 / b); elseif (b <= 0.102) 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, -8.5e-104], N[(N[(1.0 / a), $MachinePrecision] / N[(-1.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.102], 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 -8.5 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{1}{a}}{\frac{-1.5}{b}}\\
\mathbf{elif}\;b \leq 0.102:\\
\;\;\;\;\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 < -8.50000000000000007e-104Initial program 73.3%
sqr-neg73.3%
sqr-neg73.3%
associate-*l*73.3%
Simplified73.3%
Applied egg-rr58.2%
Taylor expanded in b around -inf 88.3%
*-commutative88.3%
associate-*l/88.3%
associate-/l*88.2%
Simplified88.2%
associate-*r/88.3%
metadata-eval88.3%
associate-/l*88.4%
un-div-inv88.3%
*-commutative88.3%
clear-num88.3%
un-div-inv88.4%
*-commutative88.4%
associate-/r*88.4%
metadata-eval88.4%
Applied egg-rr88.4%
if -8.50000000000000007e-104 < b < 0.101999999999999993Initial program 78.0%
sqr-neg78.0%
sqr-neg78.0%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in b around 0 73.3%
*-un-lft-identity73.3%
add-sqr-sqrt42.4%
sqrt-unprod73.0%
sqr-neg73.0%
sqrt-prod31.0%
add-sqr-sqrt72.4%
associate-*r*72.5%
*-commutative72.5%
*-commutative72.5%
Applied egg-rr72.5%
*-lft-identity72.5%
Simplified72.5%
if 0.101999999999999993 < b Initial program 14.4%
sqr-neg14.4%
sqr-neg14.4%
associate-*l*14.4%
Simplified14.4%
Applied egg-rr19.6%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.8%
Simplified90.8%
Taylor expanded in c around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification84.6%
(FPCore (a b c)
:precision binary64
(if (<= b -4.8e-104)
(/ (/ 1.0 a) (/ -1.5 b))
(if (<= b 0.102)
(* 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 <= -4.8e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= (-4.8d-104)) then
tmp = (1.0d0 / a) / ((-1.5d0) / b)
else if (b <= 0.102d0) 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 <= -4.8e-104) {
tmp = (1.0 / a) / (-1.5 / b);
} else if (b <= 0.102) {
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 <= -4.8e-104: tmp = (1.0 / a) / (-1.5 / b) elif b <= 0.102: 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 <= -4.8e-104) tmp = Float64(Float64(1.0 / a) / Float64(-1.5 / b)); elseif (b <= 0.102) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(Float64(a * 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 <= -4.8e-104) tmp = (1.0 / a) / (-1.5 / b); elseif (b <= 0.102) 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, -4.8e-104], N[(N[(1.0 / a), $MachinePrecision] / N[(-1.5 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.102], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{1}{a}}{\frac{-1.5}{b}}\\
\mathbf{elif}\;b \leq 0.102:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot -3}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.8000000000000001e-104Initial program 73.3%
sqr-neg73.3%
sqr-neg73.3%
associate-*l*73.3%
Simplified73.3%
Applied egg-rr58.2%
Taylor expanded in b around -inf 88.3%
*-commutative88.3%
associate-*l/88.3%
associate-/l*88.2%
Simplified88.2%
associate-*r/88.3%
metadata-eval88.3%
associate-/l*88.4%
un-div-inv88.3%
*-commutative88.3%
clear-num88.3%
un-div-inv88.4%
*-commutative88.4%
associate-/r*88.4%
metadata-eval88.4%
Applied egg-rr88.4%
if -4.8000000000000001e-104 < b < 0.101999999999999993Initial program 78.0%
sqr-neg78.0%
sqr-neg78.0%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in b around 0 73.3%
*-un-lft-identity73.3%
*-un-lft-identity73.3%
times-frac73.3%
metadata-eval73.3%
add-sqr-sqrt42.4%
sqrt-unprod73.0%
sqr-neg73.0%
sqrt-prod31.0%
add-sqr-sqrt72.4%
associate-*r*72.3%
*-commutative72.3%
*-commutative72.3%
Applied egg-rr72.3%
*-lft-identity72.3%
Simplified72.3%
Taylor expanded in c around 0 72.4%
if 0.101999999999999993 < b Initial program 14.4%
sqr-neg14.4%
sqr-neg14.4%
associate-*l*14.4%
Simplified14.4%
Applied egg-rr19.6%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt90.8%
Simplified90.8%
Taylor expanded in c around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification84.6%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (/ 1.0 a) (/ -1.5 b)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = (1.0 / a) / (-1.5 / 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 = (1.0d0 / a) / ((-1.5d0) / 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 = (1.0 / a) / (-1.5 / b);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = (1.0 / a) / (-1.5 / b) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(Float64(1.0 / a) / Float64(-1.5 / 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 = (1.0 / a) / (-1.5 / b); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(1.0 / a), $MachinePrecision] / N[(-1.5 / b), $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{\frac{1}{a}}{\frac{-1.5}{b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 76.5%
sqr-neg76.5%
sqr-neg76.5%
associate-*l*76.5%
Simplified76.5%
Applied egg-rr65.2%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
associate-*l/66.2%
associate-/l*66.2%
Simplified66.2%
associate-*r/66.2%
metadata-eval66.2%
associate-/l*66.3%
un-div-inv66.2%
*-commutative66.2%
clear-num66.2%
un-div-inv66.3%
*-commutative66.3%
associate-/r*66.3%
metadata-eval66.3%
Applied egg-rr66.3%
if -4.999999999999985e-310 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.3%
Simplified30.3%
Applied egg-rr34.0%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt71.3%
Simplified71.3%
Taylor expanded in c around 0 71.6%
*-commutative71.6%
Simplified71.6%
(FPCore (a b c) :precision binary64 (if (<= b 5.5e-308) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 5.5e-308) {
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 <= 5.5d-308) 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 <= 5.5e-308) {
tmp = (b * -2.0) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 5.5e-308: 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 <= 5.5e-308) 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 <= 5.5e-308) 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, 5.5e-308], 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.5 \cdot 10^{-308}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 5.5e-308Initial program 76.5%
sqr-neg76.5%
sqr-neg76.5%
associate-*l*76.5%
Simplified76.5%
Taylor expanded in b around -inf 66.3%
*-commutative66.3%
Simplified66.3%
if 5.5e-308 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.3%
Simplified30.3%
Applied egg-rr34.0%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt71.3%
Simplified71.3%
Taylor expanded in c around 0 71.6%
*-commutative71.6%
Simplified71.6%
Final simplification68.7%
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ 1.0 (* a (/ -1.5 b))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-310) {
tmp = 1.0 / (a * (-1.5 / 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 = 1.0d0 / (a * ((-1.5d0) / 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 = 1.0 / (a * (-1.5 / b));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-310: tmp = 1.0 / (a * (-1.5 / b)) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-310) tmp = Float64(1.0 / Float64(a * Float64(-1.5 / 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 = 1.0 / (a * (-1.5 / b)); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(1.0 / N[(a * N[(-1.5 / 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{1}{a \cdot \frac{-1.5}{b}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.999999999999985e-310Initial program 76.5%
sqr-neg76.5%
sqr-neg76.5%
associate-*l*76.5%
Simplified76.5%
Applied egg-rr65.2%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
associate-*l/66.2%
associate-/l*66.2%
Simplified66.2%
associate-*r/66.2%
metadata-eval66.2%
associate-/l*66.3%
un-div-inv66.2%
clear-num66.2%
frac-times66.2%
metadata-eval66.2%
*-commutative66.2%
associate-/r*66.2%
metadata-eval66.2%
Applied egg-rr66.2%
if -4.999999999999985e-310 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.3%
Simplified30.3%
Applied egg-rr34.0%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt71.3%
Simplified71.3%
Taylor expanded in c around 0 71.6%
*-commutative71.6%
Simplified71.6%
Final simplification68.7%
(FPCore (a b c) :precision binary64 (if (<= b 8.8e-305) (* (/ b a) -0.6666666666666666) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 8.8e-305) {
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 <= 8.8d-305) 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 <= 8.8e-305) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8.8e-305: tmp = (b / a) * -0.6666666666666666 else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8.8e-305) tmp = Float64(Float64(b / a) * -0.6666666666666666); 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.8e-305) tmp = (b / a) * -0.6666666666666666; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8.8e-305], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.8 \cdot 10^{-305}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 8.79999999999999987e-305Initial program 76.5%
sqr-neg76.5%
sqr-neg76.5%
associate-*l*76.5%
Simplified76.5%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
Simplified66.2%
if 8.79999999999999987e-305 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.3%
Simplified30.3%
Applied egg-rr34.0%
Taylor expanded in b around inf 0.0%
associate-*r/0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt71.3%
Simplified71.3%
Taylor expanded in c around 0 71.6%
*-commutative71.6%
Simplified71.6%
(FPCore (a b c) :precision binary64 (if (<= b 3.8e-308) (* (/ b a) -0.6666666666666666) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 3.8e-308) {
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 <= 3.8d-308) 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 <= 3.8e-308) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 3.8e-308: tmp = (b / a) * -0.6666666666666666 else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 3.8e-308) 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 <= 3.8e-308) tmp = (b / a) * -0.6666666666666666; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 3.8e-308], 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.8 \cdot 10^{-308}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 3.79999999999999975e-308Initial program 76.5%
sqr-neg76.5%
sqr-neg76.5%
associate-*l*76.5%
Simplified76.5%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
Simplified66.2%
if 3.79999999999999975e-308 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.3%
Simplified30.3%
Taylor expanded in b around inf 71.5%
*-commutative71.5%
Simplified71.5%
Final simplification68.6%
(FPCore (a b c) :precision binary64 (if (<= b 4.3e-308) (* (/ b a) -0.6666666666666666) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 4.3e-308) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 4.3d-308) then
tmp = (b / a) * (-0.6666666666666666d0)
else
tmp = c * ((-0.5d0) / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 4.3e-308) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 4.3e-308: tmp = (b / a) * -0.6666666666666666 else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 4.3e-308) tmp = Float64(Float64(b / a) * -0.6666666666666666); else tmp = Float64(c * Float64(-0.5 / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 4.3e-308) tmp = (b / a) * -0.6666666666666666; else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 4.3e-308], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.3 \cdot 10^{-308}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 4.3000000000000002e-308Initial program 76.5%
sqr-neg76.5%
sqr-neg76.5%
associate-*l*76.5%
Simplified76.5%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
Simplified66.2%
if 4.3000000000000002e-308 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.3%
Simplified30.3%
Applied egg-rr34.0%
Taylor expanded in a around 0 34.0%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
unpow20.0%
rem-square-sqrt71.3%
associate-*l*71.1%
rem-square-sqrt0.0%
unpow20.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt71.3%
metadata-eval71.3%
Simplified71.3%
(FPCore (a b c) :precision binary64 (if (<= b 8.8e-305) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 8.8e-305) {
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 <= 8.8d-305) 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 <= 8.8e-305) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 8.8e-305: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 8.8e-305) 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 <= 8.8e-305) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 8.8e-305], 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 8.8 \cdot 10^{-305}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < 8.79999999999999987e-305Initial program 76.5%
sqr-neg76.5%
sqr-neg76.5%
associate-*l*76.5%
Simplified76.5%
Applied egg-rr65.2%
Taylor expanded in b around -inf 66.2%
*-commutative66.2%
associate-*l/66.2%
associate-/l*66.2%
Simplified66.2%
if 8.79999999999999987e-305 < b Initial program 30.3%
sqr-neg30.3%
sqr-neg30.3%
associate-*l*30.3%
Simplified30.3%
Applied egg-rr34.0%
Taylor expanded in a around 0 34.0%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
unpow20.0%
rem-square-sqrt71.3%
associate-*l*71.1%
rem-square-sqrt0.0%
unpow20.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt71.3%
metadata-eval71.3%
Simplified71.3%
(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 55.6%
sqr-neg55.6%
sqr-neg55.6%
associate-*l*55.6%
Simplified55.6%
Applied egg-rr51.0%
Taylor expanded in b around -inf 37.6%
*-commutative37.6%
associate-*l/37.6%
associate-/l*37.6%
Simplified37.6%
herbie shell --seed 2024100
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))