
(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 16 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
(let* ((t_0 (sqrt (* a (* c -3.0)))))
(if (<= b -1e+152)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b -2.25e-49)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 9e-87)
(* (- b (hypot b t_0)) (/ 1.0 (* a -3.0)))
(if (or (<= b 2.35e+30) (not (<= b 5e+33)))
(* (/ c b) -0.5)
(/ 1.0 (* 3.0 (/ a (- t_0 b))))))))))
double code(double a, double b, double c) {
double t_0 = sqrt((a * (c * -3.0)));
double tmp;
if (b <= -1e+152) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= -2.25e-49) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 9e-87) {
tmp = (b - hypot(b, t_0)) * (1.0 / (a * -3.0));
} else if ((b <= 2.35e+30) || !(b <= 5e+33)) {
tmp = (c / b) * -0.5;
} else {
tmp = 1.0 / (3.0 * (a / (t_0 - b)));
}
return tmp;
}
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt((a * (c * -3.0)));
double tmp;
if (b <= -1e+152) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= -2.25e-49) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 9e-87) {
tmp = (b - Math.hypot(b, t_0)) * (1.0 / (a * -3.0));
} else if ((b <= 2.35e+30) || !(b <= 5e+33)) {
tmp = (c / b) * -0.5;
} else {
tmp = 1.0 / (3.0 * (a / (t_0 - b)));
}
return tmp;
}
def code(a, b, c): t_0 = math.sqrt((a * (c * -3.0))) tmp = 0 if b <= -1e+152: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= -2.25e-49: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) elif b <= 9e-87: tmp = (b - math.hypot(b, t_0)) * (1.0 / (a * -3.0)) elif (b <= 2.35e+30) or not (b <= 5e+33): tmp = (c / b) * -0.5 else: tmp = 1.0 / (3.0 * (a / (t_0 - b))) return tmp
function code(a, b, c) t_0 = sqrt(Float64(a * Float64(c * -3.0))) tmp = 0.0 if (b <= -1e+152) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= -2.25e-49) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); elseif (b <= 9e-87) tmp = Float64(Float64(b - hypot(b, t_0)) * Float64(1.0 / Float64(a * -3.0))); elseif ((b <= 2.35e+30) || !(b <= 5e+33)) tmp = Float64(Float64(c / b) * -0.5); else tmp = Float64(1.0 / Float64(3.0 * Float64(a / Float64(t_0 - b)))); end return tmp end
function tmp_2 = code(a, b, c) t_0 = sqrt((a * (c * -3.0))); tmp = 0.0; if (b <= -1e+152) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= -2.25e-49) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); elseif (b <= 9e-87) tmp = (b - hypot(b, t_0)) * (1.0 / (a * -3.0)); elseif ((b <= 2.35e+30) || ~((b <= 5e+33))) tmp = (c / b) * -0.5; else tmp = 1.0 / (3.0 * (a / (t_0 - b))); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1e+152], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.25e-49], 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, 9e-87], N[(N[(b - N[Sqrt[b ^ 2 + t$95$0 ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 2.35e+30], N[Not[LessEqual[b, 5e+33]], $MachinePrecision]], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision], N[(1.0 / N[(3.0 * N[(a / N[(t$95$0 - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a \cdot \left(c \cdot -3\right)}\\
\mathbf{if}\;b \leq -1 \cdot 10^{+152}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq -2.25 \cdot 10^{-49}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 9 \cdot 10^{-87}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, t\_0\right)\right) \cdot \frac{1}{a \cdot -3}\\
\mathbf{elif}\;b \leq 2.35 \cdot 10^{+30} \lor \neg \left(b \leq 5 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{3 \cdot \frac{a}{t\_0 - b}}\\
\end{array}
\end{array}
if b < -1e152Initial program 39.4%
sqr-neg39.4%
sqr-neg39.4%
associate-*l*39.4%
Simplified39.4%
Taylor expanded in b around -inf 97.4%
mul-1-neg97.4%
*-commutative97.4%
distribute-rgt-neg-in97.4%
fma-define97.4%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in c around 0 97.8%
if -1e152 < b < -2.2500000000000001e-49Initial program 92.7%
if -2.2500000000000001e-49 < b < 8.99999999999999915e-87Initial program 81.1%
sqr-neg81.1%
sqr-neg81.1%
associate-*l*81.0%
Simplified81.0%
Applied egg-rr82.2%
if 8.99999999999999915e-87 < b < 2.34999999999999995e30 or 4.99999999999999973e33 < b Initial program 10.4%
sqr-neg10.4%
sqr-neg10.4%
associate-*l*10.4%
Simplified10.4%
Taylor expanded in b around inf 93.4%
*-commutative93.4%
Simplified93.4%
if 2.34999999999999995e30 < b < 4.99999999999999973e33Initial program 51.2%
sqr-neg51.2%
sqr-neg51.2%
associate-*l*51.2%
Simplified51.2%
Taylor expanded in b around 0 51.2%
*-commutative51.2%
associate-*r*51.2%
Simplified51.2%
+-commutative51.2%
unsub-neg51.2%
Applied egg-rr51.2%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
Simplified51.2%
clear-num51.2%
inv-pow51.2%
associate-/l*51.2%
*-commutative51.2%
*-commutative51.2%
associate-*l*51.2%
Applied egg-rr51.2%
unpow-151.2%
Simplified51.2%
Final simplification90.2%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (* a (* c -3.0)))))
(if (<= b -5e+151)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b -2.25e-49)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 2.5e-90)
(/ (* (- b (hypot b t_0)) -0.3333333333333333) a)
(if (or (<= b 2.35e+30) (not (<= b 5e+33)))
(* (/ c b) -0.5)
(/ 1.0 (* 3.0 (/ a (- t_0 b))))))))))
double code(double a, double b, double c) {
double t_0 = sqrt((a * (c * -3.0)));
double tmp;
if (b <= -5e+151) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= -2.25e-49) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 2.5e-90) {
tmp = ((b - hypot(b, t_0)) * -0.3333333333333333) / a;
} else if ((b <= 2.35e+30) || !(b <= 5e+33)) {
tmp = (c / b) * -0.5;
} else {
tmp = 1.0 / (3.0 * (a / (t_0 - b)));
}
return tmp;
}
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt((a * (c * -3.0)));
double tmp;
if (b <= -5e+151) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= -2.25e-49) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 2.5e-90) {
tmp = ((b - Math.hypot(b, t_0)) * -0.3333333333333333) / a;
} else if ((b <= 2.35e+30) || !(b <= 5e+33)) {
tmp = (c / b) * -0.5;
} else {
tmp = 1.0 / (3.0 * (a / (t_0 - b)));
}
return tmp;
}
def code(a, b, c): t_0 = math.sqrt((a * (c * -3.0))) tmp = 0 if b <= -5e+151: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= -2.25e-49: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) elif b <= 2.5e-90: tmp = ((b - math.hypot(b, t_0)) * -0.3333333333333333) / a elif (b <= 2.35e+30) or not (b <= 5e+33): tmp = (c / b) * -0.5 else: tmp = 1.0 / (3.0 * (a / (t_0 - b))) return tmp
function code(a, b, c) t_0 = sqrt(Float64(a * Float64(c * -3.0))) tmp = 0.0 if (b <= -5e+151) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= -2.25e-49) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); elseif (b <= 2.5e-90) tmp = Float64(Float64(Float64(b - hypot(b, t_0)) * -0.3333333333333333) / a); elseif ((b <= 2.35e+30) || !(b <= 5e+33)) tmp = Float64(Float64(c / b) * -0.5); else tmp = Float64(1.0 / Float64(3.0 * Float64(a / Float64(t_0 - b)))); end return tmp end
function tmp_2 = code(a, b, c) t_0 = sqrt((a * (c * -3.0))); tmp = 0.0; if (b <= -5e+151) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= -2.25e-49) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); elseif (b <= 2.5e-90) tmp = ((b - hypot(b, t_0)) * -0.3333333333333333) / a; elseif ((b <= 2.35e+30) || ~((b <= 5e+33))) tmp = (c / b) * -0.5; else tmp = 1.0 / (3.0 * (a / (t_0 - b))); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -5e+151], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.25e-49], 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.5e-90], N[(N[(N[(b - N[Sqrt[b ^ 2 + t$95$0 ^ 2], $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[b, 2.35e+30], N[Not[LessEqual[b, 5e+33]], $MachinePrecision]], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision], N[(1.0 / N[(3.0 * N[(a / N[(t$95$0 - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a \cdot \left(c \cdot -3\right)}\\
\mathbf{if}\;b \leq -5 \cdot 10^{+151}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq -2.25 \cdot 10^{-49}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-90}:\\
\;\;\;\;\frac{\left(b - \mathsf{hypot}\left(b, t\_0\right)\right) \cdot -0.3333333333333333}{a}\\
\mathbf{elif}\;b \leq 2.35 \cdot 10^{+30} \lor \neg \left(b \leq 5 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{3 \cdot \frac{a}{t\_0 - b}}\\
\end{array}
\end{array}
if b < -5.0000000000000002e151Initial program 39.4%
sqr-neg39.4%
sqr-neg39.4%
associate-*l*39.4%
Simplified39.4%
Taylor expanded in b around -inf 97.4%
mul-1-neg97.4%
*-commutative97.4%
distribute-rgt-neg-in97.4%
fma-define97.4%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in c around 0 97.8%
if -5.0000000000000002e151 < b < -2.2500000000000001e-49Initial program 92.7%
if -2.2500000000000001e-49 < b < 2.5000000000000001e-90Initial program 81.1%
sqr-neg81.1%
sqr-neg81.1%
associate-*l*81.0%
Simplified81.0%
Applied egg-rr82.2%
associate-*r/82.2%
*-commutative82.2%
frac-times82.2%
un-div-inv82.1%
div-inv82.1%
metadata-eval82.1%
Applied egg-rr82.1%
if 2.5000000000000001e-90 < b < 2.34999999999999995e30 or 4.99999999999999973e33 < b Initial program 10.4%
sqr-neg10.4%
sqr-neg10.4%
associate-*l*10.4%
Simplified10.4%
Taylor expanded in b around inf 93.4%
*-commutative93.4%
Simplified93.4%
if 2.34999999999999995e30 < b < 4.99999999999999973e33Initial program 51.2%
sqr-neg51.2%
sqr-neg51.2%
associate-*l*51.2%
Simplified51.2%
Taylor expanded in b around 0 51.2%
*-commutative51.2%
associate-*r*51.2%
Simplified51.2%
+-commutative51.2%
unsub-neg51.2%
Applied egg-rr51.2%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
Simplified51.2%
clear-num51.2%
inv-pow51.2%
associate-/l*51.2%
*-commutative51.2%
*-commutative51.2%
associate-*l*51.2%
Applied egg-rr51.2%
unpow-151.2%
Simplified51.2%
Final simplification90.2%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (sqrt (* a (* c -3.0)))))
(if (<= b -2.45e+153)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b -2.25e-49)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 6.6e-87)
(/ -0.3333333333333333 (/ a (- b (hypot b t_0))))
(if (or (<= b 1e+27) (not (<= b 5e+33)))
(* (/ c b) -0.5)
(/ 1.0 (* 3.0 (/ a (- t_0 b))))))))))
double code(double a, double b, double c) {
double t_0 = sqrt((a * (c * -3.0)));
double tmp;
if (b <= -2.45e+153) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= -2.25e-49) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 6.6e-87) {
tmp = -0.3333333333333333 / (a / (b - hypot(b, t_0)));
} else if ((b <= 1e+27) || !(b <= 5e+33)) {
tmp = (c / b) * -0.5;
} else {
tmp = 1.0 / (3.0 * (a / (t_0 - b)));
}
return tmp;
}
public static double code(double a, double b, double c) {
double t_0 = Math.sqrt((a * (c * -3.0)));
double tmp;
if (b <= -2.45e+153) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= -2.25e-49) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 6.6e-87) {
tmp = -0.3333333333333333 / (a / (b - Math.hypot(b, t_0)));
} else if ((b <= 1e+27) || !(b <= 5e+33)) {
tmp = (c / b) * -0.5;
} else {
tmp = 1.0 / (3.0 * (a / (t_0 - b)));
}
return tmp;
}
def code(a, b, c): t_0 = math.sqrt((a * (c * -3.0))) tmp = 0 if b <= -2.45e+153: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= -2.25e-49: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) elif b <= 6.6e-87: tmp = -0.3333333333333333 / (a / (b - math.hypot(b, t_0))) elif (b <= 1e+27) or not (b <= 5e+33): tmp = (c / b) * -0.5 else: tmp = 1.0 / (3.0 * (a / (t_0 - b))) return tmp
function code(a, b, c) t_0 = sqrt(Float64(a * Float64(c * -3.0))) tmp = 0.0 if (b <= -2.45e+153) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= -2.25e-49) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); elseif (b <= 6.6e-87) tmp = Float64(-0.3333333333333333 / Float64(a / Float64(b - hypot(b, t_0)))); elseif ((b <= 1e+27) || !(b <= 5e+33)) tmp = Float64(Float64(c / b) * -0.5); else tmp = Float64(1.0 / Float64(3.0 * Float64(a / Float64(t_0 - b)))); end return tmp end
function tmp_2 = code(a, b, c) t_0 = sqrt((a * (c * -3.0))); tmp = 0.0; if (b <= -2.45e+153) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= -2.25e-49) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); elseif (b <= 6.6e-87) tmp = -0.3333333333333333 / (a / (b - hypot(b, t_0))); elseif ((b <= 1e+27) || ~((b <= 5e+33))) tmp = (c / b) * -0.5; else tmp = 1.0 / (3.0 * (a / (t_0 - b))); end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -2.45e+153], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -2.25e-49], 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, 6.6e-87], N[(-0.3333333333333333 / N[(a / N[(b - N[Sqrt[b ^ 2 + t$95$0 ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 1e+27], N[Not[LessEqual[b, 5e+33]], $MachinePrecision]], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision], N[(1.0 / N[(3.0 * N[(a / N[(t$95$0 - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{a \cdot \left(c \cdot -3\right)}\\
\mathbf{if}\;b \leq -2.45 \cdot 10^{+153}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq -2.25 \cdot 10^{-49}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{a}{b - \mathsf{hypot}\left(b, t\_0\right)}}\\
\mathbf{elif}\;b \leq 10^{+27} \lor \neg \left(b \leq 5 \cdot 10^{+33}\right):\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{3 \cdot \frac{a}{t\_0 - b}}\\
\end{array}
\end{array}
if b < -2.45000000000000001e153Initial program 39.4%
sqr-neg39.4%
sqr-neg39.4%
associate-*l*39.4%
Simplified39.4%
Taylor expanded in b around -inf 97.4%
mul-1-neg97.4%
*-commutative97.4%
distribute-rgt-neg-in97.4%
fma-define97.4%
associate-*r/97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in c around 0 97.8%
if -2.45000000000000001e153 < b < -2.2500000000000001e-49Initial program 92.7%
if -2.2500000000000001e-49 < b < 6.6000000000000001e-87Initial program 81.1%
sqr-neg81.1%
sqr-neg81.1%
associate-*l*81.0%
Simplified81.0%
Applied egg-rr82.2%
associate-*r/82.2%
*-commutative82.2%
frac-times82.2%
un-div-inv82.1%
div-inv82.1%
metadata-eval82.1%
Applied egg-rr82.1%
clear-num82.1%
inv-pow82.1%
*-un-lft-identity82.1%
*-commutative82.1%
times-frac82.0%
metadata-eval82.0%
Applied egg-rr82.0%
unpow-182.0%
rem-square-sqrt0.0%
unpow20.0%
associate-/r*0.0%
unpow20.0%
rem-square-sqrt82.0%
metadata-eval82.0%
Simplified82.0%
if 6.6000000000000001e-87 < b < 1e27 or 4.99999999999999973e33 < b Initial program 10.4%
sqr-neg10.4%
sqr-neg10.4%
associate-*l*10.4%
Simplified10.4%
Taylor expanded in b around inf 93.4%
*-commutative93.4%
Simplified93.4%
if 1e27 < b < 4.99999999999999973e33Initial program 51.2%
sqr-neg51.2%
sqr-neg51.2%
associate-*l*51.2%
Simplified51.2%
Taylor expanded in b around 0 51.2%
*-commutative51.2%
associate-*r*51.2%
Simplified51.2%
+-commutative51.2%
unsub-neg51.2%
Applied egg-rr51.2%
associate-*r*51.2%
*-commutative51.2%
*-commutative51.2%
Simplified51.2%
clear-num51.2%
inv-pow51.2%
associate-/l*51.2%
*-commutative51.2%
*-commutative51.2%
associate-*l*51.2%
Applied egg-rr51.2%
unpow-151.2%
Simplified51.2%
Final simplification90.2%
(FPCore (a b c)
:precision binary64
(if (<= b -8.8e+173)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 2.6e-88)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.8e+173) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 2.6e-88) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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+173)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 2.6d-88) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.8e+173) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 2.6e-88) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.8e+173: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 2.6e-88: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.8e+173) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 2.6e-88) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -8.8e+173) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 2.6e-88) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.8e+173], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e-88], 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], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+173}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-88}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.7999999999999999e173Initial program 42.8%
sqr-neg42.8%
sqr-neg42.8%
associate-*l*42.8%
Simplified42.8%
Taylor expanded in b around -inf 97.3%
mul-1-neg97.3%
*-commutative97.3%
distribute-rgt-neg-in97.3%
fma-define97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in c around 0 97.7%
if -8.7999999999999999e173 < b < 2.60000000000000014e-88Initial program 82.5%
if 2.60000000000000014e-88 < b Initial program 11.3%
sqr-neg11.3%
sqr-neg11.3%
associate-*l*11.3%
Simplified11.3%
Taylor expanded in b around inf 91.4%
*-commutative91.4%
Simplified91.4%
Final simplification88.0%
(FPCore (a b c)
:precision binary64
(if (<= b -8.8e+173)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 7.8e-90)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -8.8e+173) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 7.8e-90) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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+173)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 7.8d-90) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -8.8e+173) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 7.8e-90) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -8.8e+173: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 7.8e-90: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -8.8e+173) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 7.8e-90) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -8.8e+173) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 7.8e-90) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -8.8e+173], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e-90], 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 / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+173}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{-90}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -8.7999999999999999e173Initial program 42.8%
sqr-neg42.8%
sqr-neg42.8%
associate-*l*42.8%
Simplified42.8%
Taylor expanded in b around -inf 97.3%
mul-1-neg97.3%
*-commutative97.3%
distribute-rgt-neg-in97.3%
fma-define97.3%
associate-*r/97.4%
metadata-eval97.4%
Simplified97.4%
Taylor expanded in c around 0 97.7%
if -8.7999999999999999e173 < b < 7.80000000000000009e-90Initial program 82.5%
sqr-neg82.5%
sqr-neg82.5%
associate-*l*82.4%
Simplified82.4%
if 7.80000000000000009e-90 < b Initial program 11.3%
sqr-neg11.3%
sqr-neg11.3%
associate-*l*11.3%
Simplified11.3%
Taylor expanded in b around inf 91.4%
*-commutative91.4%
Simplified91.4%
Final simplification88.0%
(FPCore (a b c)
:precision binary64
(if (<= b -4.4e+14)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 5.2e-87)
(/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e+14) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.2e-87) {
tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
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.4d+14)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 5.2d-87) then
tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.4e+14) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 5.2e-87) {
tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.4e+14: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 5.2e-87: tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.4e+14) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 5.2e-87) tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.4e+14) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 5.2e-87) tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.4e+14], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-87], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{+14}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -4.4e14Initial program 59.7%
sqr-neg59.7%
sqr-neg59.7%
associate-*l*59.7%
Simplified59.7%
Taylor expanded in b around -inf 90.9%
mul-1-neg90.9%
*-commutative90.9%
distribute-rgt-neg-in90.9%
fma-define90.9%
associate-*r/91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in c around 0 91.1%
if -4.4e14 < b < 5.20000000000000005e-87Initial program 83.3%
sqr-neg83.3%
sqr-neg83.3%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in b around 0 69.4%
*-commutative69.4%
*-commutative69.4%
associate-*r*69.5%
Simplified69.5%
if 5.20000000000000005e-87 < b Initial program 11.3%
sqr-neg11.3%
sqr-neg11.3%
associate-*l*11.3%
Simplified11.3%
Taylor expanded in b around inf 91.4%
*-commutative91.4%
Simplified91.4%
Final simplification83.4%
(FPCore (a b c)
:precision binary64
(if (<= b -3.5e+14)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 8.5e-87)
(* (- (sqrt (* a (* c -3.0))) b) (/ 0.3333333333333333 a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e+14) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 8.5e-87) {
tmp = (sqrt((a * (c * -3.0))) - b) * (0.3333333333333333 / a);
} else {
tmp = (c / b) * -0.5;
}
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.5d+14)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 8.5d-87) then
tmp = (sqrt((a * (c * (-3.0d0)))) - b) * (0.3333333333333333d0 / a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e+14) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 8.5e-87) {
tmp = (Math.sqrt((a * (c * -3.0))) - b) * (0.3333333333333333 / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.5e+14: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 8.5e-87: tmp = (math.sqrt((a * (c * -3.0))) - b) * (0.3333333333333333 / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.5e+14) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 8.5e-87) tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) * Float64(0.3333333333333333 / a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.5e+14) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 8.5e-87) tmp = (sqrt((a * (c * -3.0))) - b) * (0.3333333333333333 / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.5e+14], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.5e-87], N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+14}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-87}:\\
\;\;\;\;\left(\sqrt{a \cdot \left(c \cdot -3\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.5e14Initial program 59.7%
sqr-neg59.7%
sqr-neg59.7%
associate-*l*59.7%
Simplified59.7%
Taylor expanded in b around -inf 90.9%
mul-1-neg90.9%
*-commutative90.9%
distribute-rgt-neg-in90.9%
fma-define90.9%
associate-*r/91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in c around 0 91.1%
if -3.5e14 < b < 8.5000000000000001e-87Initial program 83.3%
sqr-neg83.3%
sqr-neg83.3%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in b around 0 69.4%
*-commutative69.4%
associate-*r*69.4%
Simplified69.4%
+-commutative69.4%
unsub-neg69.4%
Applied egg-rr69.4%
associate-*r*69.4%
*-commutative69.4%
*-commutative69.4%
Simplified69.4%
clear-num69.3%
associate-/r/69.3%
associate-/r*69.4%
metadata-eval69.4%
*-commutative69.4%
*-commutative69.4%
associate-*l*69.5%
Applied egg-rr69.5%
if 8.5000000000000001e-87 < b Initial program 11.3%
sqr-neg11.3%
sqr-neg11.3%
associate-*l*11.3%
Simplified11.3%
Taylor expanded in b around inf 91.4%
*-commutative91.4%
Simplified91.4%
Final simplification83.4%
(FPCore (a b c)
:precision binary64
(if (<= b -3.5e+14)
(+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
(if (<= b 8.2e-106)
(* 0.3333333333333333 (/ (- (sqrt (* a (* c -3.0))) b) a))
(* (/ c b) -0.5))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e+14) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 8.2e-106) {
tmp = 0.3333333333333333 * ((sqrt((a * (c * -3.0))) - b) / a);
} else {
tmp = (c / b) * -0.5;
}
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.5d+14)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
else if (b <= 8.2d-106) then
tmp = 0.3333333333333333d0 * ((sqrt((a * (c * (-3.0d0)))) - b) / a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -3.5e+14) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else if (b <= 8.2e-106) {
tmp = 0.3333333333333333 * ((Math.sqrt((a * (c * -3.0))) - b) / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.5e+14: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) elif b <= 8.2e-106: tmp = 0.3333333333333333 * ((math.sqrt((a * (c * -3.0))) - b) / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.5e+14) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b))); elseif (b <= 8.2e-106) tmp = Float64(0.3333333333333333 * Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.5e+14) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); elseif (b <= 8.2e-106) tmp = 0.3333333333333333 * ((sqrt((a * (c * -3.0))) - b) / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.5e+14], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.2e-106], N[(0.3333333333333333 * N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.5 \cdot 10^{+14}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{-106}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -3.5e14Initial program 59.7%
sqr-neg59.7%
sqr-neg59.7%
associate-*l*59.7%
Simplified59.7%
Taylor expanded in b around -inf 90.9%
mul-1-neg90.9%
*-commutative90.9%
distribute-rgt-neg-in90.9%
fma-define90.9%
associate-*r/91.0%
metadata-eval91.0%
Simplified91.0%
Taylor expanded in c around 0 91.1%
if -3.5e14 < b < 8.1999999999999998e-106Initial program 82.7%
sqr-neg82.7%
sqr-neg82.7%
associate-*l*82.6%
Simplified82.6%
Taylor expanded in b around 0 68.3%
*-commutative68.3%
associate-*r*68.4%
Simplified68.4%
+-commutative68.4%
unsub-neg68.4%
Applied egg-rr68.4%
associate-*r*68.3%
*-commutative68.3%
*-commutative68.3%
Simplified68.3%
*-un-lft-identity68.3%
div-inv68.3%
*-commutative68.3%
*-commutative68.3%
associate-*l*68.5%
associate-/r*68.5%
metadata-eval68.5%
Applied egg-rr68.5%
*-lft-identity68.5%
*-commutative68.5%
associate-*l/68.4%
associate-*r/68.3%
Simplified68.3%
if 8.1999999999999998e-106 < b Initial program 14.3%
sqr-neg14.3%
sqr-neg14.3%
associate-*l*14.3%
Simplified14.3%
Taylor expanded in b around inf 88.5%
*-commutative88.5%
Simplified88.5%
(FPCore (a b c) :precision binary64 (if (<= b -6.8e-232) (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -6.8e-232) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / 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 <= (-6.8d-232)) then
tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / 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 <= -6.8e-232) {
tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6.8e-232: tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6.8e-232) tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / 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 <= -6.8e-232) tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b)); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6.8e-232], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.8 \cdot 10^{-232}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -6.8000000000000004e-232Initial program 70.6%
sqr-neg70.6%
sqr-neg70.6%
associate-*l*70.6%
Simplified70.6%
Taylor expanded in b around -inf 65.6%
mul-1-neg65.6%
*-commutative65.6%
distribute-rgt-neg-in65.6%
fma-define65.6%
associate-*r/65.7%
metadata-eval65.7%
Simplified65.7%
Taylor expanded in c around 0 67.6%
if -6.8000000000000004e-232 < b Initial program 31.4%
sqr-neg31.4%
sqr-neg31.4%
associate-*l*31.3%
Simplified31.3%
Applied egg-rr34.7%
associate-*r/34.7%
*-commutative34.7%
frac-times34.7%
associate-*l/34.7%
un-div-inv34.7%
Applied egg-rr34.7%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in c around 0 67.1%
associate-*r/67.1%
*-commutative67.1%
Simplified67.1%
(FPCore (a b c) :precision binary64 (if (<= b -1.9e-201) (/ (/ (* b 2.0) a) -3.0) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-201) {
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 <= (-1.9d-201)) 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 <= -1.9e-201) {
tmp = ((b * 2.0) / a) / -3.0;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.9e-201: 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 <= -1.9e-201) tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.9e-201) 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, -1.9e-201], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-201}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.9e-201Initial program 69.9%
sqr-neg69.9%
sqr-neg69.9%
associate-*l*69.9%
Simplified69.9%
Applied egg-rr57.2%
associate-*r/57.3%
*-commutative57.3%
frac-times57.1%
associate-*l/57.2%
un-div-inv57.3%
Applied egg-rr57.3%
Taylor expanded in b around -inf 68.7%
*-commutative68.7%
Simplified68.7%
if -1.9e-201 < b Initial program 33.9%
sqr-neg33.9%
sqr-neg33.9%
associate-*l*33.8%
Simplified33.8%
Applied egg-rr37.8%
associate-*r/37.7%
*-commutative37.7%
frac-times37.7%
associate-*l/37.7%
un-div-inv37.7%
Applied egg-rr37.7%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt63.8%
metadata-eval63.8%
Simplified63.8%
Taylor expanded in c around 0 64.1%
associate-*r/64.1%
*-commutative64.1%
Simplified64.1%
(FPCore (a b c) :precision binary64 (if (<= b -1.9e-201) (/ b (* a -1.5)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-201) {
tmp = b / (a * -1.5);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.9d-201)) then
tmp = b / (a * (-1.5d0))
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-201) {
tmp = b / (a * -1.5);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.9e-201: tmp = b / (a * -1.5) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.9e-201) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.9e-201) tmp = b / (a * -1.5); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.9e-201], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-201}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.9e-201Initial program 69.9%
sqr-neg69.9%
sqr-neg69.9%
associate-*l*69.9%
Simplified69.9%
pow1/269.9%
associate-*r*69.9%
fma-neg70.0%
associate-*r*70.0%
*-commutative70.0%
distribute-rgt-neg-in70.0%
metadata-eval70.0%
associate-*r*70.0%
pow-to-exp66.8%
Applied egg-rr66.8%
Taylor expanded in b around -inf 68.6%
*-commutative68.6%
associate-*l/68.5%
associate-/l*68.6%
Simplified68.6%
clear-num68.6%
div-inv68.6%
metadata-eval68.6%
un-div-inv68.7%
Applied egg-rr68.7%
if -1.9e-201 < b Initial program 33.9%
sqr-neg33.9%
sqr-neg33.9%
associate-*l*33.8%
Simplified33.8%
Applied egg-rr37.8%
associate-*r/37.7%
*-commutative37.7%
frac-times37.7%
associate-*l/37.7%
un-div-inv37.7%
Applied egg-rr37.7%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt63.8%
metadata-eval63.8%
Simplified63.8%
Taylor expanded in c around 0 64.1%
associate-*r/64.1%
*-commutative64.1%
Simplified64.1%
(FPCore (a b c) :precision binary64 (if (<= b -1.9e-201) (/ b (* a -1.5)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-201) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.9d-201)) then
tmp = b / (a * (-1.5d0))
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-201) {
tmp = b / (a * -1.5);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.9e-201: tmp = b / (a * -1.5) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.9e-201) tmp = Float64(b / Float64(a * -1.5)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.9e-201) tmp = b / (a * -1.5); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.9e-201], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-201}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -1.9e-201Initial program 69.9%
sqr-neg69.9%
sqr-neg69.9%
associate-*l*69.9%
Simplified69.9%
pow1/269.9%
associate-*r*69.9%
fma-neg70.0%
associate-*r*70.0%
*-commutative70.0%
distribute-rgt-neg-in70.0%
metadata-eval70.0%
associate-*r*70.0%
pow-to-exp66.8%
Applied egg-rr66.8%
Taylor expanded in b around -inf 68.6%
*-commutative68.6%
associate-*l/68.5%
associate-/l*68.6%
Simplified68.6%
clear-num68.6%
div-inv68.6%
metadata-eval68.6%
un-div-inv68.7%
Applied egg-rr68.7%
if -1.9e-201 < b Initial program 33.9%
sqr-neg33.9%
sqr-neg33.9%
associate-*l*33.8%
Simplified33.8%
Taylor expanded in b around inf 64.1%
*-commutative64.1%
Simplified64.1%
(FPCore (a b c) :precision binary64 (if (<= b -1.9e-201) (* -0.6666666666666666 (/ b a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-201) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.9d-201)) then
tmp = (-0.6666666666666666d0) * (b / a)
else
tmp = (c / b) * (-0.5d0)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.9e-201) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.9e-201: tmp = -0.6666666666666666 * (b / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.9e-201) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = Float64(Float64(c / b) * -0.5); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.9e-201) tmp = -0.6666666666666666 * (b / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.9e-201], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-201}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < -1.9e-201Initial program 69.9%
sqr-neg69.9%
sqr-neg69.9%
associate-*l*69.9%
Simplified69.9%
Taylor expanded in b around -inf 68.6%
*-commutative68.6%
Simplified68.6%
if -1.9e-201 < b Initial program 33.9%
sqr-neg33.9%
sqr-neg33.9%
associate-*l*33.8%
Simplified33.8%
Taylor expanded in b around inf 64.1%
*-commutative64.1%
Simplified64.1%
Final simplification66.3%
(FPCore (a b c) :precision binary64 (if (<= b -6.8e-232) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -6.8e-232) {
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 <= (-6.8d-232)) 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 <= -6.8e-232) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = c * (-0.5 / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -6.8e-232: tmp = b * (-0.6666666666666666 / a) else: tmp = c * (-0.5 / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -6.8e-232) 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 <= -6.8e-232) tmp = b * (-0.6666666666666666 / a); else tmp = c * (-0.5 / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -6.8e-232], 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 -6.8 \cdot 10^{-232}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;c \cdot \frac{-0.5}{b}\\
\end{array}
\end{array}
if b < -6.8000000000000004e-232Initial program 70.6%
sqr-neg70.6%
sqr-neg70.6%
associate-*l*70.6%
Simplified70.6%
pow1/270.6%
associate-*r*70.6%
fma-neg70.7%
associate-*r*70.7%
*-commutative70.7%
distribute-rgt-neg-in70.7%
metadata-eval70.7%
associate-*r*70.7%
pow-to-exp67.3%
Applied egg-rr67.3%
Taylor expanded in b around -inf 66.5%
*-commutative66.5%
associate-*l/66.4%
associate-/l*66.5%
Simplified66.5%
if -6.8000000000000004e-232 < b Initial program 31.4%
sqr-neg31.4%
sqr-neg31.4%
associate-*l*31.3%
Simplified31.3%
Applied egg-rr34.7%
associate-*r/34.7%
*-commutative34.7%
frac-times34.7%
associate-*l/34.7%
un-div-inv34.7%
Applied egg-rr34.7%
Taylor expanded in b around inf 0.0%
*-commutative0.0%
associate-/l*0.0%
associate-*l*0.0%
*-commutative0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt66.9%
metadata-eval66.9%
Simplified66.9%
(FPCore (a b c) :precision binary64 (if (<= b -2.9e-199) (* b (/ -0.6666666666666666 a)) (* 0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.9e-199) {
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 <= (-2.9d-199)) 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 <= -2.9e-199) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = 0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.9e-199: tmp = b * (-0.6666666666666666 / a) else: tmp = 0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.9e-199) tmp = Float64(b * Float64(-0.6666666666666666 / a)); else tmp = Float64(0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.9e-199) tmp = b * (-0.6666666666666666 / a); else tmp = 0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.9e-199], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{-199}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < -2.9e-199Initial program 69.7%
sqr-neg69.7%
sqr-neg69.7%
associate-*l*69.7%
Simplified69.7%
pow1/269.7%
associate-*r*69.7%
fma-neg69.8%
associate-*r*69.7%
*-commutative69.7%
distribute-rgt-neg-in69.7%
metadata-eval69.7%
associate-*r*69.7%
pow-to-exp66.6%
Applied egg-rr66.6%
Taylor expanded in b around -inf 69.1%
*-commutative69.1%
associate-*l/69.1%
associate-/l*69.1%
Simplified69.1%
if -2.9e-199 < b Initial program 34.4%
sqr-neg34.4%
sqr-neg34.4%
associate-*l*34.3%
Simplified34.3%
Taylor expanded in b around -inf 2.3%
mul-1-neg2.3%
*-commutative2.3%
distribute-rgt-neg-in2.3%
fma-define2.3%
associate-*r/2.3%
metadata-eval2.3%
Simplified2.3%
Taylor expanded in c around inf 14.2%
(FPCore (a b c) :precision binary64 (* 0.5 (/ c b)))
double code(double a, double b, double c) {
return 0.5 * (c / b);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = 0.5d0 * (c / b)
end function
public static double code(double a, double b, double c) {
return 0.5 * (c / b);
}
def code(a, b, c): return 0.5 * (c / b)
function code(a, b, c) return Float64(0.5 * Float64(c / b)) end
function tmp = code(a, b, c) tmp = 0.5 * (c / b); end
code[a_, b_, c_] := N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \frac{c}{b}
\end{array}
Initial program 51.9%
sqr-neg51.9%
sqr-neg51.9%
associate-*l*51.9%
Simplified51.9%
Taylor expanded in b around -inf 35.4%
mul-1-neg35.4%
*-commutative35.4%
distribute-rgt-neg-in35.4%
fma-define35.4%
associate-*r/35.5%
metadata-eval35.5%
Simplified35.5%
Taylor expanded in c around inf 9.2%
herbie shell --seed 2024107
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))