
(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.25e+121)
(* (/ b a) -0.6666666666666666)
(if (<= b 6.5e-80)
(/ (- (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.25e+121) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 6.5e-80) {
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.25d+121)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 6.5d-80) 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.25e+121) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 6.5e-80) {
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.25e+121: tmp = (b / a) * -0.6666666666666666 elif b <= 6.5e-80: 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.25e+121) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 6.5e-80) 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.25e+121) tmp = (b / a) * -0.6666666666666666; elseif (b <= 6.5e-80) 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.25e+121], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 6.5e-80], 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.25 \cdot 10^{+121}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{-80}:\\
\;\;\;\;\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.25000000000000009e121Initial program 47.1%
sqr-neg47.1%
sqr-neg47.1%
associate-*l*47.1%
Simplified47.1%
Taylor expanded in b around -inf 95.9%
*-commutative95.9%
Simplified95.9%
if -3.25000000000000009e121 < b < 6.49999999999999984e-80Initial program 80.3%
if 6.49999999999999984e-80 < b Initial program 14.5%
sqr-neg14.5%
sqr-neg14.5%
associate-*l*14.5%
Simplified14.5%
frac-2neg14.5%
div-inv14.5%
Applied egg-rr14.5%
Taylor expanded in b around inf 87.7%
associate-*r/87.7%
*-commutative87.7%
Simplified87.7%
Final simplification86.1%
(FPCore (a b c)
:precision binary64
(if (<= b -3.6e+120)
(* (/ b a) -0.6666666666666666)
(if (<= b 9.2e-79)
(/ (- (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.6e+120) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 9.2e-79) {
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.6d+120)) then
tmp = (b / a) * (-0.6666666666666666d0)
else if (b <= 9.2d-79) 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.6e+120) {
tmp = (b / a) * -0.6666666666666666;
} else if (b <= 9.2e-79) {
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.6e+120: tmp = (b / a) * -0.6666666666666666 elif b <= 9.2e-79: 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.6e+120) tmp = Float64(Float64(b / a) * -0.6666666666666666); elseif (b <= 9.2e-79) 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.6e+120) tmp = (b / a) * -0.6666666666666666; elseif (b <= 9.2e-79) 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.6e+120], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 9.2e-79], 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.6 \cdot 10^{+120}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{-79}:\\
\;\;\;\;\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.60000000000000016e120Initial program 47.1%
sqr-neg47.1%
sqr-neg47.1%
associate-*l*47.1%
Simplified47.1%
Taylor expanded in b around -inf 95.9%
*-commutative95.9%
Simplified95.9%
if -3.60000000000000016e120 < b < 9.20000000000000047e-79Initial program 80.3%
sqr-neg80.3%
sqr-neg80.3%
associate-*l*80.0%
Simplified80.0%
if 9.20000000000000047e-79 < b Initial program 14.5%
sqr-neg14.5%
sqr-neg14.5%
associate-*l*14.5%
Simplified14.5%
frac-2neg14.5%
div-inv14.5%
Applied egg-rr14.5%
Taylor expanded in b around inf 87.7%
associate-*r/87.7%
*-commutative87.7%
Simplified87.7%
Final simplification85.9%
(FPCore (a b c)
:precision binary64
(if (<= b -5.2e-107)
(* b (- (* 0.6666666666666666 (/ -1.0 a)) (* -0.5 (/ c (pow b 2.0)))))
(if (<= b 1.9e-80)
(/ (+ 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 <= -5.2e-107) {
tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / pow(b, 2.0))));
} else if (b <= 1.9e-80) {
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 <= (-5.2d-107)) then
tmp = b * ((0.6666666666666666d0 * ((-1.0d0) / a)) - ((-0.5d0) * (c / (b ** 2.0d0))))
else if (b <= 1.9d-80) 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 <= -5.2e-107) {
tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / Math.pow(b, 2.0))));
} else if (b <= 1.9e-80) {
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 <= -5.2e-107: tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / math.pow(b, 2.0)))) elif b <= 1.9e-80: 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 <= -5.2e-107) tmp = Float64(b * Float64(Float64(0.6666666666666666 * Float64(-1.0 / a)) - Float64(-0.5 * Float64(c / (b ^ 2.0))))); elseif (b <= 1.9e-80) 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 <= -5.2e-107) tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / (b ^ 2.0)))); elseif (b <= 1.9e-80) 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, -5.2e-107], N[(b * N[(N[(0.6666666666666666 * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.9e-80], 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 -5.2 \cdot 10^{-107}:\\
\;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\
\mathbf{elif}\;b \leq 1.9 \cdot 10^{-80}:\\
\;\;\;\;\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 < -5.2000000000000001e-107Initial program 69.8%
sqr-neg69.8%
sqr-neg69.8%
associate-*l*69.8%
Simplified69.8%
Taylor expanded in b around -inf 86.4%
if -5.2000000000000001e-107 < b < 1.89999999999999983e-80Initial program 71.1%
sqr-neg71.1%
sqr-neg71.1%
associate-*l*70.5%
Simplified70.5%
Taylor expanded in b around 0 69.9%
*-un-lft-identity69.9%
*-un-lft-identity69.9%
times-frac69.9%
metadata-eval69.9%
add-sqr-sqrt22.2%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-prod48.3%
add-sqr-sqrt70.0%
associate-*r*70.3%
*-commutative70.3%
*-commutative70.3%
Applied egg-rr70.3%
*-lft-identity70.3%
metadata-eval70.3%
times-frac70.4%
*-lft-identity70.4%
*-commutative70.4%
Simplified70.4%
if 1.89999999999999983e-80 < b Initial program 14.5%
sqr-neg14.5%
sqr-neg14.5%
associate-*l*14.5%
Simplified14.5%
frac-2neg14.5%
div-inv14.5%
Applied egg-rr14.5%
Taylor expanded in b around inf 87.7%
associate-*r/87.7%
*-commutative87.7%
Simplified87.7%
Final simplification83.2%
(FPCore (a b c)
:precision binary64
(if (<= b -1.65e-105)
(* (/ b 3.0) (/ -2.0 a))
(if (<= b 3.1e-82)
(/ (+ 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 <= -1.65e-105) {
tmp = (b / 3.0) * (-2.0 / a);
} else if (b <= 3.1e-82) {
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 <= (-1.65d-105)) then
tmp = (b / 3.0d0) * ((-2.0d0) / a)
else if (b <= 3.1d-82) 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 <= -1.65e-105) {
tmp = (b / 3.0) * (-2.0 / a);
} else if (b <= 3.1e-82) {
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 <= -1.65e-105: tmp = (b / 3.0) * (-2.0 / a) elif b <= 3.1e-82: 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 <= -1.65e-105) tmp = Float64(Float64(b / 3.0) * Float64(-2.0 / a)); elseif (b <= 3.1e-82) 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 <= -1.65e-105) tmp = (b / 3.0) * (-2.0 / a); elseif (b <= 3.1e-82) 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, -1.65e-105], N[(N[(b / 3.0), $MachinePrecision] * N[(-2.0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e-82], 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 -1.65 \cdot 10^{-105}:\\
\;\;\;\;\frac{b}{3} \cdot \frac{-2}{a}\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{-82}:\\
\;\;\;\;\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 < -1.6499999999999999e-105Initial program 69.8%
add-exp-log32.5%
Applied egg-rr32.5%
Taylor expanded in b around -inf 38.5%
*-commutative38.5%
Simplified38.5%
rem-exp-log86.2%
times-frac86.3%
Applied egg-rr86.3%
if -1.6499999999999999e-105 < b < 3.1e-82Initial program 71.1%
sqr-neg71.1%
sqr-neg71.1%
associate-*l*70.5%
Simplified70.5%
Taylor expanded in b around 0 69.9%
*-un-lft-identity69.9%
*-un-lft-identity69.9%
times-frac69.9%
metadata-eval69.9%
add-sqr-sqrt22.2%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-prod48.3%
add-sqr-sqrt70.0%
associate-*r*70.3%
*-commutative70.3%
*-commutative70.3%
Applied egg-rr70.3%
*-lft-identity70.3%
metadata-eval70.3%
times-frac70.4%
*-lft-identity70.4%
*-commutative70.4%
Simplified70.4%
if 3.1e-82 < b Initial program 14.5%
sqr-neg14.5%
sqr-neg14.5%
associate-*l*14.5%
Simplified14.5%
frac-2neg14.5%
div-inv14.5%
Applied egg-rr14.5%
Taylor expanded in b around inf 87.7%
associate-*r/87.7%
*-commutative87.7%
Simplified87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -2.8e-107)
(* (/ b 3.0) (/ -2.0 a))
(if (<= b 3e-76)
(* 0.3333333333333333 (/ (+ b (sqrt (* c (* a -3.0)))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.8e-107) {
tmp = (b / 3.0) * (-2.0 / a);
} else if (b <= 3e-76) {
tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -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 <= (-2.8d-107)) then
tmp = (b / 3.0d0) * ((-2.0d0) / a)
else if (b <= 3d-76) then
tmp = 0.3333333333333333d0 * ((b + sqrt((c * (a * (-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 <= -2.8e-107) {
tmp = (b / 3.0) * (-2.0 / a);
} else if (b <= 3e-76) {
tmp = 0.3333333333333333 * ((b + Math.sqrt((c * (a * -3.0)))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.8e-107: tmp = (b / 3.0) * (-2.0 / a) elif b <= 3e-76: tmp = 0.3333333333333333 * ((b + math.sqrt((c * (a * -3.0)))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.8e-107) tmp = Float64(Float64(b / 3.0) * Float64(-2.0 / a)); elseif (b <= 3e-76) tmp = Float64(0.3333333333333333 * Float64(Float64(b + sqrt(Float64(c * Float64(a * -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 <= -2.8e-107) tmp = (b / 3.0) * (-2.0 / a); elseif (b <= 3e-76) tmp = 0.3333333333333333 * ((b + sqrt((c * (a * -3.0)))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.8e-107], N[(N[(b / 3.0), $MachinePrecision] * N[(-2.0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-76], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(c * N[(a * -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 -2.8 \cdot 10^{-107}:\\
\;\;\;\;\frac{b}{3} \cdot \frac{-2}{a}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-76}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.7999999999999999e-107Initial program 69.8%
add-exp-log32.5%
Applied egg-rr32.5%
Taylor expanded in b around -inf 38.5%
*-commutative38.5%
Simplified38.5%
rem-exp-log86.2%
times-frac86.3%
Applied egg-rr86.3%
if -2.7999999999999999e-107 < b < 3.00000000000000024e-76Initial program 71.1%
sqr-neg71.1%
sqr-neg71.1%
associate-*l*70.5%
Simplified70.5%
Taylor expanded in b around 0 69.9%
*-un-lft-identity69.9%
*-un-lft-identity69.9%
times-frac69.9%
metadata-eval69.9%
add-sqr-sqrt22.2%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-prod48.3%
add-sqr-sqrt70.0%
associate-*r*70.3%
*-commutative70.3%
*-commutative70.3%
Applied egg-rr70.3%
*-lft-identity70.3%
Simplified70.3%
if 3.00000000000000024e-76 < b Initial program 14.5%
sqr-neg14.5%
sqr-neg14.5%
associate-*l*14.5%
Simplified14.5%
frac-2neg14.5%
div-inv14.5%
Applied egg-rr14.5%
Taylor expanded in b around inf 87.7%
associate-*r/87.7%
*-commutative87.7%
Simplified87.7%
(FPCore (a b c)
:precision binary64
(if (<= b -1.6e-107)
(* (/ b 3.0) (/ -2.0 a))
(if (<= b 9.2e-78)
(* 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 <= -1.6e-107) {
tmp = (b / 3.0) * (-2.0 / a);
} else if (b <= 9.2e-78) {
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 <= (-1.6d-107)) then
tmp = (b / 3.0d0) * ((-2.0d0) / a)
else if (b <= 9.2d-78) 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 <= -1.6e-107) {
tmp = (b / 3.0) * (-2.0 / a);
} else if (b <= 9.2e-78) {
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 <= -1.6e-107: tmp = (b / 3.0) * (-2.0 / a) elif b <= 9.2e-78: 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 <= -1.6e-107) tmp = Float64(Float64(b / 3.0) * Float64(-2.0 / a)); elseif (b <= 9.2e-78) 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 <= -1.6e-107) tmp = (b / 3.0) * (-2.0 / a); elseif (b <= 9.2e-78) 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, -1.6e-107], N[(N[(b / 3.0), $MachinePrecision] * N[(-2.0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.2e-78], 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 -1.6 \cdot 10^{-107}:\\
\;\;\;\;\frac{b}{3} \cdot \frac{-2}{a}\\
\mathbf{elif}\;b \leq 9.2 \cdot 10^{-78}:\\
\;\;\;\;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 < -1.60000000000000006e-107Initial program 69.8%
add-exp-log32.5%
Applied egg-rr32.5%
Taylor expanded in b around -inf 38.5%
*-commutative38.5%
Simplified38.5%
rem-exp-log86.2%
times-frac86.3%
Applied egg-rr86.3%
if -1.60000000000000006e-107 < b < 9.2000000000000007e-78Initial program 71.1%
sqr-neg71.1%
sqr-neg71.1%
associate-*l*70.5%
Simplified70.5%
Taylor expanded in b around 0 69.9%
*-un-lft-identity69.9%
*-un-lft-identity69.9%
times-frac69.9%
metadata-eval69.9%
add-sqr-sqrt22.2%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-prod48.3%
add-sqr-sqrt70.0%
associate-*r*70.3%
*-commutative70.3%
*-commutative70.3%
Applied egg-rr70.3%
*-lft-identity70.3%
Simplified70.3%
Taylor expanded in c around 0 70.0%
if 9.2000000000000007e-78 < b Initial program 14.5%
sqr-neg14.5%
sqr-neg14.5%
associate-*l*14.5%
Simplified14.5%
frac-2neg14.5%
div-inv14.5%
Applied egg-rr14.5%
Taylor expanded in b around inf 87.7%
associate-*r/87.7%
*-commutative87.7%
Simplified87.7%
Final simplification83.0%
(FPCore (a b c) :precision binary64 (if (<= b 1.8e-306) (* (/ b 3.0) (/ -2.0 a)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.8e-306) {
tmp = (b / 3.0) * (-2.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.8d-306) then
tmp = (b / 3.0d0) * ((-2.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.8e-306) {
tmp = (b / 3.0) * (-2.0 / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.8e-306: tmp = (b / 3.0) * (-2.0 / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.8e-306) tmp = Float64(Float64(b / 3.0) * Float64(-2.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.8e-306) tmp = (b / 3.0) * (-2.0 / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.8e-306], N[(N[(b / 3.0), $MachinePrecision] * N[(-2.0 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.8 \cdot 10^{-306}:\\
\;\;\;\;\frac{b}{3} \cdot \frac{-2}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.79999999999999996e-306Initial program 70.7%
add-exp-log32.9%
Applied egg-rr32.9%
Taylor expanded in b around -inf 32.5%
*-commutative32.5%
Simplified32.5%
rem-exp-log73.6%
times-frac73.6%
Applied egg-rr73.6%
if 1.79999999999999996e-306 < b Initial program 30.4%
sqr-neg30.4%
sqr-neg30.4%
associate-*l*30.2%
Simplified30.2%
frac-2neg30.2%
div-inv30.1%
Applied egg-rr30.3%
Taylor expanded in b around inf 67.1%
associate-*r/67.1%
*-commutative67.1%
Simplified67.1%
(FPCore (a b c) :precision binary64 (if (<= b 1.8e-306) (/ (* b -0.6666666666666666) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.8e-306) {
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 <= 1.8d-306) 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 <= 1.8e-306) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.8e-306: tmp = (b * -0.6666666666666666) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.8e-306) 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 <= 1.8e-306) tmp = (b * -0.6666666666666666) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.8e-306], 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 1.8 \cdot 10^{-306}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.79999999999999996e-306Initial program 70.7%
sqr-neg70.7%
sqr-neg70.7%
associate-*l*70.7%
Simplified70.7%
Taylor expanded in b around -inf 73.5%
*-commutative73.5%
Simplified73.5%
associate-*l/73.6%
Applied egg-rr73.6%
if 1.79999999999999996e-306 < b Initial program 30.4%
sqr-neg30.4%
sqr-neg30.4%
associate-*l*30.2%
Simplified30.2%
frac-2neg30.2%
div-inv30.1%
Applied egg-rr30.3%
Taylor expanded in b around inf 67.1%
associate-*r/67.1%
*-commutative67.1%
Simplified67.1%
(FPCore (a b c) :precision binary64 (if (<= b 1.8e-306) (/ (* b -0.6666666666666666) a) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.8e-306) {
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 <= 1.8d-306) 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 <= 1.8e-306) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.8e-306: tmp = (b * -0.6666666666666666) / a else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.8e-306) 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 <= 1.8e-306) tmp = (b * -0.6666666666666666) / a; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.8e-306], 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 1.8 \cdot 10^{-306}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 1.79999999999999996e-306Initial program 70.7%
sqr-neg70.7%
sqr-neg70.7%
associate-*l*70.7%
Simplified70.7%
Taylor expanded in b around -inf 73.5%
*-commutative73.5%
Simplified73.5%
associate-*l/73.6%
Applied egg-rr73.6%
if 1.79999999999999996e-306 < b Initial program 30.4%
sqr-neg30.4%
sqr-neg30.4%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in b around inf 67.1%
*-commutative67.1%
Simplified67.1%
Final simplification70.0%
(FPCore (a b c) :precision binary64 (if (<= b 1.8e-306) (/ b (* a -1.5)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.8e-306) {
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 <= 1.8d-306) 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 <= 1.8e-306) {
tmp = b / (a * -1.5);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.8e-306: tmp = b / (a * -1.5) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.8e-306) 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 <= 1.8e-306) tmp = b / (a * -1.5); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.8e-306], 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 1.8 \cdot 10^{-306}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 1.79999999999999996e-306Initial program 70.7%
sqr-neg70.7%
sqr-neg70.7%
associate-*l*70.7%
Simplified70.7%
frac-2neg70.7%
div-inv70.7%
Applied egg-rr70.8%
Taylor expanded in b around -inf 73.5%
*-commutative73.5%
associate-*l/73.6%
associate-/l*73.5%
Simplified73.5%
clear-num73.4%
un-div-inv73.5%
div-inv73.6%
metadata-eval73.6%
Applied egg-rr73.6%
if 1.79999999999999996e-306 < b Initial program 30.4%
sqr-neg30.4%
sqr-neg30.4%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in b around inf 67.1%
*-commutative67.1%
Simplified67.1%
Final simplification70.0%
(FPCore (a b c) :precision binary64 (if (<= b 1.8e-306) (* (/ b a) -0.6666666666666666) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.8e-306) {
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 <= 1.8d-306) 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 <= 1.8e-306) {
tmp = (b / a) * -0.6666666666666666;
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.8e-306: tmp = (b / a) * -0.6666666666666666 else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.8e-306) 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 <= 1.8e-306) tmp = (b / a) * -0.6666666666666666; else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.8e-306], 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 1.8 \cdot 10^{-306}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 1.79999999999999996e-306Initial program 70.7%
sqr-neg70.7%
sqr-neg70.7%
associate-*l*70.7%
Simplified70.7%
Taylor expanded in b around -inf 73.5%
*-commutative73.5%
Simplified73.5%
if 1.79999999999999996e-306 < b Initial program 30.4%
sqr-neg30.4%
sqr-neg30.4%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in b around inf 67.1%
*-commutative67.1%
Simplified67.1%
Final simplification70.0%
(FPCore (a b c) :precision binary64 (* (/ b a) -0.6666666666666666))
double code(double a, double b, double c) {
return (b / a) * -0.6666666666666666;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (b / a) * (-0.6666666666666666d0)
end function
public static double code(double a, double b, double c) {
return (b / a) * -0.6666666666666666;
}
def code(a, b, c): return (b / a) * -0.6666666666666666
function code(a, b, c) return Float64(Float64(b / a) * -0.6666666666666666) end
function tmp = code(a, b, c) tmp = (b / a) * -0.6666666666666666; end
code[a_, b_, c_] := N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{a} \cdot -0.6666666666666666
\end{array}
Initial program 48.5%
sqr-neg48.5%
sqr-neg48.5%
associate-*l*48.4%
Simplified48.4%
Taylor expanded in b around -inf 34.5%
*-commutative34.5%
Simplified34.5%
(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.5%
sqr-neg48.5%
sqr-neg48.5%
associate-*l*48.4%
Simplified48.4%
frac-2neg48.4%
div-inv48.4%
Applied egg-rr48.5%
Taylor expanded in b around -inf 34.5%
*-commutative34.5%
associate-*l/34.5%
associate-/l*34.5%
Simplified34.5%
(FPCore (a b c) :precision binary64 (* b (* a 0.6666666666666666)))
double code(double a, double b, double c) {
return b * (a * 0.6666666666666666);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = b * (a * 0.6666666666666666d0)
end function
public static double code(double a, double b, double c) {
return b * (a * 0.6666666666666666);
}
def code(a, b, c): return b * (a * 0.6666666666666666)
function code(a, b, c) return Float64(b * Float64(a * 0.6666666666666666)) end
function tmp = code(a, b, c) tmp = b * (a * 0.6666666666666666); end
code[a_, b_, c_] := N[(b * N[(a * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a \cdot 0.6666666666666666\right)
\end{array}
Initial program 48.5%
sqr-neg48.5%
sqr-neg48.5%
associate-*l*48.4%
Simplified48.4%
clear-num48.3%
associate-/r/48.4%
associate-/r*48.4%
metadata-eval48.4%
add-sqr-sqrt31.3%
sqrt-unprod45.7%
sqr-neg45.7%
sqrt-prod14.5%
add-sqr-sqrt28.1%
fma-neg28.1%
associate-*r*28.2%
*-commutative28.2%
distribute-rgt-neg-in28.2%
*-commutative28.2%
distribute-rgt-neg-in28.2%
metadata-eval28.2%
Applied egg-rr28.2%
Taylor expanded in a around 0 2.6%
*-commutative2.6%
Simplified2.6%
pow12.6%
div-inv2.6%
add-exp-log1.2%
exp-neg1.2%
associate-*l*1.2%
add-sqr-sqrt0.5%
sqrt-unprod1.1%
sqr-neg1.1%
sqrt-unprod0.5%
add-sqr-sqrt1.3%
add-exp-log2.6%
Applied egg-rr2.6%
unpow12.6%
Simplified2.6%
herbie shell --seed 2024110
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))