
(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 -2.15e+79)
(/ 1.0 (* (/ a b) -1.5))
(if (<= b -6.2e-75)
(/ (- (sqrt (fma b b (* a (* c -3.0)))) b) (* a 3.0))
(if (<= b 5e-157)
(* (- b (hypot b (sqrt (* c (* a -3.0))))) (/ 1.0 (* a -3.0)))
(if (<= b 6.1e+124)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
0.0)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.15e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -6.2e-75) {
tmp = (sqrt(fma(b, b, (a * (c * -3.0)))) - b) / (a * 3.0);
} else if (b <= 5e-157) {
tmp = (b - hypot(b, sqrt((c * (a * -3.0))))) * (1.0 / (a * -3.0));
} else if (b <= 6.1e+124) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = 0.0;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -2.15e+79) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); elseif (b <= -6.2e-75) tmp = Float64(Float64(sqrt(fma(b, b, Float64(a * Float64(c * -3.0)))) - b) / Float64(a * 3.0)); elseif (b <= 5e-157) tmp = Float64(Float64(b - hypot(b, sqrt(Float64(c * Float64(a * -3.0))))) * Float64(1.0 / Float64(a * -3.0))); elseif (b <= 6.1e+124) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = 0.0; end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -2.15e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.2e-75], N[(N[(N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-157], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.1e+124], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-75}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-157}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right) \cdot \frac{1}{a \cdot -3}\\
\mathbf{elif}\;b \leq 6.1 \cdot 10^{+124}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -2.1500000000000002e79Initial program 67.5%
sqr-neg67.5%
sqr-neg67.5%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in b around -inf 94.7%
mul-1-neg94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
count-294.7%
times-frac94.8%
metadata-eval94.8%
add-sqr-sqrt94.5%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
Applied egg-rr0.8%
unpow-10.8%
Simplified0.8%
associate-*r/0.8%
add-sqr-sqrt0.0%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod94.5%
add-sqr-sqrt94.7%
distribute-neg-frac294.7%
associate-*r/94.8%
neg-sub081.3%
Applied egg-rr81.3%
neg-sub094.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if -2.1500000000000002e79 < b < -6.20000000000000013e-75Initial program 99.5%
/-rgt-identity99.5%
metadata-eval99.5%
Simplified99.5%
if -6.20000000000000013e-75 < b < 5.0000000000000002e-157Initial program 71.8%
sqr-neg71.8%
sqr-neg71.8%
associate-*l*71.7%
Simplified71.7%
Applied egg-rr80.3%
*-commutative80.3%
associate-*r*80.4%
Simplified80.4%
if 5.0000000000000002e-157 < b < 6.1000000000000001e124Initial program 88.9%
if 6.1000000000000001e124 < b Initial program 10.8%
sqr-neg10.8%
sqr-neg10.8%
associate-*l*13.2%
Simplified13.2%
Taylor expanded in b around -inf 4.6%
mul-1-neg4.6%
Simplified4.6%
unsub-neg4.6%
div-sub4.6%
add-sqr-sqrt0.0%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod43.4%
add-sqr-sqrt61.9%
*-commutative61.9%
*-commutative61.9%
Applied egg-rr61.9%
+-inverses100.0%
Simplified100.0%
Final simplification92.3%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))))
(if (<= b -2.15e+79)
(/ 1.0 (* (/ a b) -1.5))
(if (<= b -3.6e-232)
t_0
(if (<= b 5e-147)
(* (/ -0.3333333333333333 a) (- b (hypot b (sqrt (* -3.0 (* a c))))))
(if (<= b 1e+124) t_0 0.0))))))
double code(double a, double b, double c) {
double t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
double tmp;
if (b <= -2.15e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -3.6e-232) {
tmp = t_0;
} else if (b <= 5e-147) {
tmp = (-0.3333333333333333 / a) * (b - hypot(b, sqrt((-3.0 * (a * c)))));
} else if (b <= 1e+124) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double a, double b, double c) {
double t_0 = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
double tmp;
if (b <= -2.15e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -3.6e-232) {
tmp = t_0;
} else if (b <= 5e-147) {
tmp = (-0.3333333333333333 / a) * (b - Math.hypot(b, Math.sqrt((-3.0 * (a * c)))));
} else if (b <= 1e+124) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): t_0 = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) tmp = 0 if b <= -2.15e+79: tmp = 1.0 / ((a / b) * -1.5) elif b <= -3.6e-232: tmp = t_0 elif b <= 5e-147: tmp = (-0.3333333333333333 / a) * (b - math.hypot(b, math.sqrt((-3.0 * (a * c))))) elif b <= 1e+124: tmp = t_0 else: tmp = 0.0 return tmp
function code(a, b, c) t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) tmp = 0.0 if (b <= -2.15e+79) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); elseif (b <= -3.6e-232) tmp = t_0; elseif (b <= 5e-147) tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b - hypot(b, sqrt(Float64(-3.0 * Float64(a * c)))))); elseif (b <= 1e+124) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); tmp = 0.0; if (b <= -2.15e+79) tmp = 1.0 / ((a / b) * -1.5); elseif (b <= -3.6e-232) tmp = t_0; elseif (b <= 5e-147) tmp = (-0.3333333333333333 / a) * (b - hypot(b, sqrt((-3.0 * (a * c))))); elseif (b <= 1e+124) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.15e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.6e-232], t$95$0, If[LessEqual[b, 5e-147], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e+124], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{elif}\;b \leq -3.6 \cdot 10^{-232}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right)\\
\mathbf{elif}\;b \leq 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -2.1500000000000002e79Initial program 67.5%
sqr-neg67.5%
sqr-neg67.5%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in b around -inf 94.7%
mul-1-neg94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
count-294.7%
times-frac94.8%
metadata-eval94.8%
add-sqr-sqrt94.5%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
Applied egg-rr0.8%
unpow-10.8%
Simplified0.8%
associate-*r/0.8%
add-sqr-sqrt0.0%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod94.5%
add-sqr-sqrt94.7%
distribute-neg-frac294.7%
associate-*r/94.8%
neg-sub081.3%
Applied egg-rr81.3%
neg-sub094.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if -2.1500000000000002e79 < b < -3.60000000000000016e-232 or 5.00000000000000013e-147 < b < 9.99999999999999948e123Initial program 91.6%
if -3.60000000000000016e-232 < b < 5.00000000000000013e-147Initial program 63.8%
sqr-neg63.8%
sqr-neg63.8%
associate-*l*63.7%
Simplified63.7%
Applied egg-rr78.4%
*-commutative78.4%
associate-/r*78.4%
metadata-eval78.4%
Simplified78.4%
Taylor expanded in a around 0 78.5%
if 9.99999999999999948e123 < b Initial program 10.8%
sqr-neg10.8%
sqr-neg10.8%
associate-*l*13.2%
Simplified13.2%
Taylor expanded in b around -inf 4.6%
mul-1-neg4.6%
Simplified4.6%
unsub-neg4.6%
div-sub4.6%
add-sqr-sqrt0.0%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod43.4%
add-sqr-sqrt61.9%
*-commutative61.9%
*-commutative61.9%
Applied egg-rr61.9%
+-inverses100.0%
Simplified100.0%
Final simplification92.3%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))))
(if (<= b -1.2e+79)
(/ 1.0 (* (/ a b) -1.5))
(if (<= b -6.5e-84)
t_0
(if (<= b 8.5e-133)
(* (- b (hypot b (sqrt (* a (* c -3.0))))) (/ -0.3333333333333333 a))
(if (<= b 5e+124) t_0 0.0))))))
double code(double a, double b, double c) {
double t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
double tmp;
if (b <= -1.2e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -6.5e-84) {
tmp = t_0;
} else if (b <= 8.5e-133) {
tmp = (b - hypot(b, sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a);
} else if (b <= 5e+124) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double a, double b, double c) {
double t_0 = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
double tmp;
if (b <= -1.2e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -6.5e-84) {
tmp = t_0;
} else if (b <= 8.5e-133) {
tmp = (b - Math.hypot(b, Math.sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a);
} else if (b <= 5e+124) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): t_0 = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) tmp = 0 if b <= -1.2e+79: tmp = 1.0 / ((a / b) * -1.5) elif b <= -6.5e-84: tmp = t_0 elif b <= 8.5e-133: tmp = (b - math.hypot(b, math.sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a) elif b <= 5e+124: tmp = t_0 else: tmp = 0.0 return tmp
function code(a, b, c) t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) tmp = 0.0 if (b <= -1.2e+79) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); elseif (b <= -6.5e-84) tmp = t_0; elseif (b <= 8.5e-133) tmp = Float64(Float64(b - hypot(b, sqrt(Float64(a * Float64(c * -3.0))))) * Float64(-0.3333333333333333 / a)); elseif (b <= 5e+124) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); tmp = 0.0; if (b <= -1.2e+79) tmp = 1.0 / ((a / b) * -1.5); elseif (b <= -6.5e-84) tmp = t_0; elseif (b <= 8.5e-133) tmp = (b - hypot(b, sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a); elseif (b <= 5e+124) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.2e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.5e-84], t$95$0, If[LessEqual[b, 8.5e-133], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e+124], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{elif}\;b \leq -6.5 \cdot 10^{-84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-133}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{-0.3333333333333333}{a}\\
\mathbf{elif}\;b \leq 5 \cdot 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -1.19999999999999993e79Initial program 67.5%
sqr-neg67.5%
sqr-neg67.5%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in b around -inf 94.7%
mul-1-neg94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
count-294.7%
times-frac94.8%
metadata-eval94.8%
add-sqr-sqrt94.5%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
Applied egg-rr0.8%
unpow-10.8%
Simplified0.8%
associate-*r/0.8%
add-sqr-sqrt0.0%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod94.5%
add-sqr-sqrt94.7%
distribute-neg-frac294.7%
associate-*r/94.8%
neg-sub081.3%
Applied egg-rr81.3%
neg-sub094.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if -1.19999999999999993e79 < b < -6.50000000000000022e-84 or 8.49999999999999957e-133 < b < 4.9999999999999996e124Initial program 93.9%
if -6.50000000000000022e-84 < b < 8.49999999999999957e-133Initial program 72.3%
sqr-neg72.3%
sqr-neg72.3%
associate-*l*72.1%
Simplified72.1%
Applied egg-rr80.6%
*-commutative80.6%
associate-/r*80.7%
metadata-eval80.7%
Simplified80.7%
if 4.9999999999999996e124 < b Initial program 10.8%
sqr-neg10.8%
sqr-neg10.8%
associate-*l*13.2%
Simplified13.2%
Taylor expanded in b around -inf 4.6%
mul-1-neg4.6%
Simplified4.6%
unsub-neg4.6%
div-sub4.6%
add-sqr-sqrt0.0%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod43.4%
add-sqr-sqrt61.9%
*-commutative61.9%
*-commutative61.9%
Applied egg-rr61.9%
+-inverses100.0%
Simplified100.0%
Final simplification92.3%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))))
(if (<= b -1.95e+79)
(/ 1.0 (* (/ a b) -1.5))
(if (<= b -9.2e-222)
t_0
(if (<= b 2.3e-110)
(/ (/ (- b (hypot b (sqrt (* a (* c -3.0))))) a) -3.0)
(if (<= b 1e+124) t_0 0.0))))))
double code(double a, double b, double c) {
double t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
double tmp;
if (b <= -1.95e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -9.2e-222) {
tmp = t_0;
} else if (b <= 2.3e-110) {
tmp = ((b - hypot(b, sqrt((a * (c * -3.0))))) / a) / -3.0;
} else if (b <= 1e+124) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double a, double b, double c) {
double t_0 = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
double tmp;
if (b <= -1.95e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -9.2e-222) {
tmp = t_0;
} else if (b <= 2.3e-110) {
tmp = ((b - Math.hypot(b, Math.sqrt((a * (c * -3.0))))) / a) / -3.0;
} else if (b <= 1e+124) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): t_0 = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) tmp = 0 if b <= -1.95e+79: tmp = 1.0 / ((a / b) * -1.5) elif b <= -9.2e-222: tmp = t_0 elif b <= 2.3e-110: tmp = ((b - math.hypot(b, math.sqrt((a * (c * -3.0))))) / a) / -3.0 elif b <= 1e+124: tmp = t_0 else: tmp = 0.0 return tmp
function code(a, b, c) t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) tmp = 0.0 if (b <= -1.95e+79) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); elseif (b <= -9.2e-222) tmp = t_0; elseif (b <= 2.3e-110) tmp = Float64(Float64(Float64(b - hypot(b, sqrt(Float64(a * Float64(c * -3.0))))) / a) / -3.0); elseif (b <= 1e+124) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); tmp = 0.0; if (b <= -1.95e+79) tmp = 1.0 / ((a / b) * -1.5); elseif (b <= -9.2e-222) tmp = t_0; elseif (b <= 2.3e-110) tmp = ((b - hypot(b, sqrt((a * (c * -3.0))))) / a) / -3.0; elseif (b <= 1e+124) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.95e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -9.2e-222], t$95$0, If[LessEqual[b, 2.3e-110], N[(N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 1e+124], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -1.95 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{elif}\;b \leq -9.2 \cdot 10^{-222}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-110}:\\
\;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{a}}{-3}\\
\mathbf{elif}\;b \leq 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -1.9499999999999999e79Initial program 67.5%
sqr-neg67.5%
sqr-neg67.5%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in b around -inf 94.7%
mul-1-neg94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
count-294.7%
times-frac94.8%
metadata-eval94.8%
add-sqr-sqrt94.5%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
Applied egg-rr0.8%
unpow-10.8%
Simplified0.8%
associate-*r/0.8%
add-sqr-sqrt0.0%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod94.5%
add-sqr-sqrt94.7%
distribute-neg-frac294.7%
associate-*r/94.8%
neg-sub081.3%
Applied egg-rr81.3%
neg-sub094.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if -1.9499999999999999e79 < b < -9.2000000000000005e-222 or 2.3000000000000001e-110 < b < 9.99999999999999948e123Initial program 91.4%
if -9.2000000000000005e-222 < b < 2.3000000000000001e-110Initial program 66.8%
sqr-neg66.8%
sqr-neg66.8%
associate-*l*66.8%
Simplified66.8%
Applied egg-rr80.0%
associate-*l/80.2%
un-div-inv80.3%
Applied egg-rr80.3%
if 9.99999999999999948e123 < b Initial program 10.8%
sqr-neg10.8%
sqr-neg10.8%
associate-*l*13.2%
Simplified13.2%
Taylor expanded in b around -inf 4.6%
mul-1-neg4.6%
Simplified4.6%
unsub-neg4.6%
div-sub4.6%
add-sqr-sqrt0.0%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod43.4%
add-sqr-sqrt61.9%
*-commutative61.9%
*-commutative61.9%
Applied egg-rr61.9%
+-inverses100.0%
Simplified100.0%
Final simplification92.3%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (* a (* c -3.0))))
(if (<= b -2.1e+79)
(/ 1.0 (* (/ a b) -1.5))
(if (<= b -1.1e-81)
(/ (- (sqrt (fma b b t_0)) b) (* a 3.0))
(if (<= b 5e-147)
(* (- b (hypot b (sqrt t_0))) (/ -0.3333333333333333 a))
(if (<= b 8.8e+124)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
0.0))))))
double code(double a, double b, double c) {
double t_0 = a * (c * -3.0);
double tmp;
if (b <= -2.1e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= -1.1e-81) {
tmp = (sqrt(fma(b, b, t_0)) - b) / (a * 3.0);
} else if (b <= 5e-147) {
tmp = (b - hypot(b, sqrt(t_0))) * (-0.3333333333333333 / a);
} else if (b <= 8.8e+124) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = 0.0;
}
return tmp;
}
function code(a, b, c) t_0 = Float64(a * Float64(c * -3.0)) tmp = 0.0 if (b <= -2.1e+79) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); elseif (b <= -1.1e-81) tmp = Float64(Float64(sqrt(fma(b, b, t_0)) - b) / Float64(a * 3.0)); elseif (b <= 5e-147) tmp = Float64(Float64(b - hypot(b, sqrt(t_0))) * Float64(-0.3333333333333333 / a)); elseif (b <= 8.8e+124) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = 0.0; end return tmp end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.1e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.1e-81], N[(N[(N[Sqrt[N[(b * b + t$95$0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-147], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[t$95$0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.8e+124], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot -3\right)\\
\mathbf{if}\;b \leq -2.1 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{elif}\;b \leq -1.1 \cdot 10^{-81}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t\_0\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{t\_0}\right)\right) \cdot \frac{-0.3333333333333333}{a}\\
\mathbf{elif}\;b \leq 8.8 \cdot 10^{+124}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -2.10000000000000008e79Initial program 67.5%
sqr-neg67.5%
sqr-neg67.5%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in b around -inf 94.7%
mul-1-neg94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
count-294.7%
times-frac94.8%
metadata-eval94.8%
add-sqr-sqrt94.5%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
Applied egg-rr0.8%
unpow-10.8%
Simplified0.8%
associate-*r/0.8%
add-sqr-sqrt0.0%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod94.5%
add-sqr-sqrt94.7%
distribute-neg-frac294.7%
associate-*r/94.8%
neg-sub081.3%
Applied egg-rr81.3%
neg-sub094.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if -2.10000000000000008e79 < b < -1.1e-81Initial program 99.5%
/-rgt-identity99.5%
metadata-eval99.5%
Simplified99.5%
if -1.1e-81 < b < 5.00000000000000013e-147Initial program 72.3%
sqr-neg72.3%
sqr-neg72.3%
associate-*l*72.1%
Simplified72.1%
Applied egg-rr80.6%
*-commutative80.6%
associate-/r*80.7%
metadata-eval80.7%
Simplified80.7%
if 5.00000000000000013e-147 < b < 8.8000000000000004e124Initial program 88.6%
if 8.8000000000000004e124 < b Initial program 10.8%
sqr-neg10.8%
sqr-neg10.8%
associate-*l*13.2%
Simplified13.2%
Taylor expanded in b around -inf 4.6%
mul-1-neg4.6%
Simplified4.6%
unsub-neg4.6%
div-sub4.6%
add-sqr-sqrt0.0%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod43.4%
add-sqr-sqrt61.9%
*-commutative61.9%
*-commutative61.9%
Applied egg-rr61.9%
+-inverses100.0%
Simplified100.0%
Final simplification92.3%
(FPCore (a b c)
:precision binary64
(if (<= b -2.15e+79)
(/ 1.0 (* (/ a b) -1.5))
(if (<= b 2e+124)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
0.0)))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.15e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= 2e+124) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-2.15d+79)) then
tmp = 1.0d0 / ((a / b) * (-1.5d0))
else if (b <= 2d+124) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (a * 3.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.15e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= 2e+124) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.15e+79: tmp = 1.0 / ((a / b) * -1.5) elif b <= 2e+124: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.15e+79) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); elseif (b <= 2e+124) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.15e+79) tmp = 1.0 / ((a / b) * -1.5); elseif (b <= 2e+124) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.15e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e+124], 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], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{+124}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -2.1500000000000002e79Initial program 67.5%
sqr-neg67.5%
sqr-neg67.5%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in b around -inf 94.7%
mul-1-neg94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
count-294.7%
times-frac94.8%
metadata-eval94.8%
add-sqr-sqrt94.5%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
Applied egg-rr0.8%
unpow-10.8%
Simplified0.8%
associate-*r/0.8%
add-sqr-sqrt0.0%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod94.5%
add-sqr-sqrt94.7%
distribute-neg-frac294.7%
associate-*r/94.8%
neg-sub081.3%
Applied egg-rr81.3%
neg-sub094.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if -2.1500000000000002e79 < b < 1.9999999999999999e124Initial program 85.3%
sqr-neg85.3%
sqr-neg85.3%
associate-*l*85.2%
Simplified85.2%
if 1.9999999999999999e124 < b Initial program 10.8%
sqr-neg10.8%
sqr-neg10.8%
associate-*l*13.2%
Simplified13.2%
Taylor expanded in b around -inf 4.6%
mul-1-neg4.6%
Simplified4.6%
unsub-neg4.6%
div-sub4.6%
add-sqr-sqrt0.0%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod43.4%
add-sqr-sqrt61.9%
*-commutative61.9%
*-commutative61.9%
Applied egg-rr61.9%
+-inverses100.0%
Simplified100.0%
Final simplification90.4%
(FPCore (a b c)
:precision binary64
(if (<= b -1.75e+79)
(/ 1.0 (* (/ a b) -1.5))
(if (<= b 5.5e+123)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
0.0)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.75e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= 5.5e+123) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.75d+79)) then
tmp = 1.0d0 / ((a / b) * (-1.5d0))
else if (b <= 5.5d+123) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.75e+79) {
tmp = 1.0 / ((a / b) * -1.5);
} else if (b <= 5.5e+123) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.75e+79: tmp = 1.0 / ((a / b) * -1.5) elif b <= 5.5e+123: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.75e+79) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); elseif (b <= 5.5e+123) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.75e+79) tmp = 1.0 / ((a / b) * -1.5); elseif (b <= 5.5e+123) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.75e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e+123], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{+123}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -1.7499999999999999e79Initial program 67.5%
sqr-neg67.5%
sqr-neg67.5%
associate-*l*67.5%
Simplified67.5%
Taylor expanded in b around -inf 94.7%
mul-1-neg94.7%
Simplified94.7%
clear-num94.7%
inv-pow94.7%
count-294.7%
times-frac94.8%
metadata-eval94.8%
add-sqr-sqrt94.5%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod0.0%
add-sqr-sqrt0.8%
Applied egg-rr0.8%
unpow-10.8%
Simplified0.8%
associate-*r/0.8%
add-sqr-sqrt0.0%
sqrt-unprod67.8%
sqr-neg67.8%
sqrt-unprod94.5%
add-sqr-sqrt94.7%
distribute-neg-frac294.7%
associate-*r/94.8%
neg-sub081.3%
Applied egg-rr81.3%
neg-sub094.8%
*-commutative94.8%
distribute-rgt-neg-in94.8%
metadata-eval94.8%
Simplified94.8%
if -1.7499999999999999e79 < b < 5.5000000000000002e123Initial program 85.3%
if 5.5000000000000002e123 < b Initial program 10.8%
sqr-neg10.8%
sqr-neg10.8%
associate-*l*13.2%
Simplified13.2%
Taylor expanded in b around -inf 4.6%
mul-1-neg4.6%
Simplified4.6%
unsub-neg4.6%
div-sub4.6%
add-sqr-sqrt0.0%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod43.4%
add-sqr-sqrt61.9%
*-commutative61.9%
*-commutative61.9%
Applied egg-rr61.9%
+-inverses100.0%
Simplified100.0%
Final simplification90.4%
(FPCore (a b c)
:precision binary64
(if (<= b -5.4e-89)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 6e-173)
(/ (- (sqrt (* -3.0 (* a c))) b) (* a 3.0))
(/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.4e-89) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 6e-173) {
tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5.4d-89)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 6d-173) then
tmp = (sqrt(((-3.0d0) * (a * c))) - b) / (a * 3.0d0)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5.4e-89) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 6e-173) {
tmp = (Math.sqrt((-3.0 * (a * c))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.4e-89: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 6e-173: tmp = (math.sqrt((-3.0 * (a * c))) - b) / (a * 3.0) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.4e-89) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 6e-173) tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(a * c))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.4e-89) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 6e-173) tmp = (sqrt((-3.0 * (a * c))) - b) / (a * 3.0); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.4e-89], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-173], N[(N[(N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.4 \cdot 10^{-89}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -5.39999999999999975e-89Initial program 79.2%
sqr-neg79.2%
sqr-neg79.2%
associate-*l*79.2%
Simplified79.2%
Taylor expanded in b around -inf 85.8%
if -5.39999999999999975e-89 < b < 6.0000000000000002e-173Initial program 76.3%
sqr-neg76.3%
sqr-neg76.3%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in b around 0 72.0%
if 6.0000000000000002e-173 < b Initial program 48.6%
sqr-neg48.6%
sqr-neg48.6%
associate-*l*49.7%
Simplified49.7%
Taylor expanded in b around inf 79.0%
associate-/l*81.2%
Simplified81.2%
Final simplification81.5%
(FPCore (a b c)
:precision binary64
(if (<= b -5.4e-89)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 6e-173)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5.4e-89) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 6e-173) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5.4d-89)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 6d-173) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5.4e-89) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 6e-173) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5.4e-89: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 6e-173: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5.4e-89) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 6e-173) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5.4e-89) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 6e-173) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5.4e-89], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-173], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.4 \cdot 10^{-89}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -5.39999999999999975e-89Initial program 79.2%
sqr-neg79.2%
sqr-neg79.2%
associate-*l*79.2%
Simplified79.2%
Taylor expanded in b around -inf 85.8%
if -5.39999999999999975e-89 < b < 6.0000000000000002e-173Initial program 76.3%
sqr-neg76.3%
sqr-neg76.3%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in b around 0 72.0%
associate-*r*72.2%
*-commutative72.2%
Simplified72.2%
if 6.0000000000000002e-173 < b Initial program 48.6%
sqr-neg48.6%
sqr-neg48.6%
associate-*l*49.7%
Simplified49.7%
Taylor expanded in b around inf 79.0%
associate-/l*81.2%
Simplified81.2%
Final simplification81.6%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b))) (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1d-310)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else
tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else {
tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) else: tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); else tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1e-310) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); else tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 78.6%
sqr-neg78.6%
sqr-neg78.6%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in b around -inf 70.3%
if -9.999999999999969e-311 < b Initial program 53.1%
sqr-neg53.1%
sqr-neg53.1%
associate-*l*54.0%
Simplified54.0%
Taylor expanded in b around inf 68.0%
associate-/l*69.9%
Simplified69.9%
Final simplification70.1%
(FPCore (a b c) :precision binary64 (if (<= b -1.18e-243) (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b))) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.18e-243) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.18d-243)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.18e-243) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.18e-243: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.18e-243) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.18e-243) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.18e-243], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.18 \cdot 10^{-243}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -1.1800000000000001e-243Initial program 78.9%
sqr-neg78.9%
sqr-neg78.9%
associate-*l*78.8%
Simplified78.8%
Taylor expanded in b around -inf 73.6%
if -1.1800000000000001e-243 < b Initial program 54.2%
sqr-neg54.2%
sqr-neg54.2%
associate-*l*55.1%
Simplified55.1%
Taylor expanded in b around -inf 3.6%
mul-1-neg3.6%
Simplified3.6%
unsub-neg3.6%
div-sub3.6%
add-sqr-sqrt0.3%
sqrt-unprod25.4%
sqr-neg25.4%
sqrt-unprod29.6%
add-sqr-sqrt47.8%
*-commutative47.8%
*-commutative47.8%
Applied egg-rr47.8%
+-inverses65.3%
Simplified65.3%
Final simplification69.9%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (/ 1.0 (* (/ a b) -1.5)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = 1.0 / ((a / b) * -1.5);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1d-310)) then
tmp = 1.0d0 / ((a / b) * (-1.5d0))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = 1.0 / ((a / b) * -1.5);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = 1.0 / ((a / b) * -1.5) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1e-310) tmp = 1.0 / ((a / b) * -1.5); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 78.6%
sqr-neg78.6%
sqr-neg78.6%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in b around -inf 69.9%
mul-1-neg69.9%
Simplified69.9%
clear-num69.8%
inv-pow69.8%
count-269.8%
times-frac70.0%
metadata-eval70.0%
add-sqr-sqrt69.7%
sqrt-unprod55.8%
sqr-neg55.8%
sqrt-unprod0.0%
add-sqr-sqrt1.5%
Applied egg-rr1.5%
unpow-11.5%
Simplified1.5%
associate-*r/1.5%
add-sqr-sqrt0.0%
sqrt-unprod55.7%
sqr-neg55.7%
sqrt-unprod69.7%
add-sqr-sqrt69.8%
distribute-neg-frac269.8%
associate-*r/70.0%
neg-sub062.6%
Applied egg-rr62.6%
neg-sub070.0%
*-commutative70.0%
distribute-rgt-neg-in70.0%
metadata-eval70.0%
Simplified70.0%
if -9.999999999999969e-311 < b Initial program 53.1%
sqr-neg53.1%
sqr-neg53.1%
associate-*l*54.0%
Simplified54.0%
Taylor expanded in b around -inf 3.5%
mul-1-neg3.5%
Simplified3.5%
unsub-neg3.5%
div-sub3.5%
add-sqr-sqrt0.0%
sqrt-unprod26.7%
sqr-neg26.7%
sqrt-unprod31.6%
add-sqr-sqrt50.7%
*-commutative50.7%
*-commutative50.7%
Applied egg-rr50.7%
+-inverses69.4%
Simplified69.4%
Final simplification69.7%
(FPCore (a b c) :precision binary64 (if (<= b -1.95e-298) (* -0.6666666666666666 (/ b a)) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.95e-298) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.95d-298)) then
tmp = (-0.6666666666666666d0) * (b / a)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.95e-298) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.95e-298: tmp = -0.6666666666666666 * (b / a) else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.95e-298) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.95e-298) tmp = -0.6666666666666666 * (b / a); else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.95e-298], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.95 \cdot 10^{-298}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -1.95000000000000014e-298Initial program 79.6%
sqr-neg79.6%
sqr-neg79.6%
associate-*l*79.5%
Simplified79.5%
Taylor expanded in b around -inf 70.7%
*-commutative70.7%
Simplified70.7%
if -1.95000000000000014e-298 < b Initial program 52.2%
sqr-neg52.2%
sqr-neg52.2%
associate-*l*53.1%
Simplified53.1%
Taylor expanded in b around -inf 3.5%
mul-1-neg3.5%
Simplified3.5%
unsub-neg3.5%
div-sub3.5%
add-sqr-sqrt0.1%
sqrt-unprod26.3%
sqr-neg26.3%
sqrt-unprod31.0%
add-sqr-sqrt49.8%
*-commutative49.8%
*-commutative49.8%
Applied egg-rr49.8%
+-inverses68.1%
Simplified68.1%
Final simplification69.6%
(FPCore (a b c) :precision binary64 (if (<= b -1.95e-298) (/ (* b -0.6666666666666666) a) 0.0))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.95e-298) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.95d-298)) then
tmp = (b * (-0.6666666666666666d0)) / a
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.95e-298) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = 0.0;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.95e-298: tmp = (b * -0.6666666666666666) / a else: tmp = 0.0 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.95e-298) tmp = Float64(Float64(b * -0.6666666666666666) / a); else tmp = 0.0; end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.95e-298) tmp = (b * -0.6666666666666666) / a; else tmp = 0.0; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.95e-298], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.95 \cdot 10^{-298}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if b < -1.95000000000000014e-298Initial program 79.6%
sqr-neg79.6%
sqr-neg79.6%
associate-*l*79.5%
Simplified79.5%
Applied egg-rr68.8%
associate-*l/68.7%
un-div-inv68.7%
Applied egg-rr68.7%
clear-num68.7%
inv-pow68.7%
Applied egg-rr68.7%
unpow-168.7%
Simplified68.7%
Taylor expanded in b around -inf 70.7%
associate-*r/70.8%
Simplified70.8%
if -1.95000000000000014e-298 < b Initial program 52.2%
sqr-neg52.2%
sqr-neg52.2%
associate-*l*53.1%
Simplified53.1%
Taylor expanded in b around -inf 3.5%
mul-1-neg3.5%
Simplified3.5%
unsub-neg3.5%
div-sub3.5%
add-sqr-sqrt0.1%
sqrt-unprod26.3%
sqr-neg26.3%
sqrt-unprod31.0%
add-sqr-sqrt49.8%
*-commutative49.8%
*-commutative49.8%
Applied egg-rr49.8%
+-inverses68.1%
Simplified68.1%
Final simplification69.6%
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
return 0.0;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.0d0
end function
public static double code(double a, double b, double c) {
return 0.0;
}
def code(a, b, c): return 0.0
function code(a, b, c) return 0.0 end
function tmp = code(a, b, c) tmp = 0.0; end
code[a_, b_, c_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 67.9%
sqr-neg67.9%
sqr-neg67.9%
associate-*l*68.3%
Simplified68.3%
Taylor expanded in b around -inf 42.2%
mul-1-neg42.2%
Simplified42.2%
unsub-neg42.2%
div-sub42.2%
add-sqr-sqrt40.6%
sqrt-unprod43.7%
sqr-neg43.7%
sqrt-unprod13.2%
add-sqr-sqrt22.6%
*-commutative22.6%
*-commutative22.6%
Applied egg-rr22.6%
+-inverses30.7%
Simplified30.7%
Final simplification30.7%
herbie shell --seed 2024047
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))