
(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
(let* ((t_0 (* c (* -3.0 (+ a a)))))
(if (<= b -2.4e+148)
(+ (/ (* b -0.6666666666666666) a) (* 0.5 (/ c b)))
(if (<= b 1.22e-126)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(if (<= b 9e+119)
(*
-0.3333333333333333
(/
(/
(+ (- (* b b) (* b b)) (- (* (* a c) -3.0) t_0))
(+ b (sqrt (+ (* b b) (- t_0 (* a (* c -3.0)))))))
a))
(/ (* c -0.5) b))))))
double code(double a, double b, double c) {
double t_0 = c * (-3.0 * (a + a));
double tmp;
if (b <= -2.4e+148) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.22e-126) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 9e+119) {
tmp = -0.3333333333333333 * (((((b * b) - (b * b)) + (((a * c) * -3.0) - t_0)) / (b + sqrt(((b * b) + (t_0 - (a * (c * -3.0))))))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_0
real(8) :: tmp
t_0 = c * ((-3.0d0) * (a + a))
if (b <= (-2.4d+148)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + (0.5d0 * (c / b))
else if (b <= 1.22d-126) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else if (b <= 9d+119) then
tmp = (-0.3333333333333333d0) * (((((b * b) - (b * b)) + (((a * c) * (-3.0d0)) - t_0)) / (b + sqrt(((b * b) + (t_0 - (a * (c * (-3.0d0)))))))) / a)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double t_0 = c * (-3.0 * (a + a));
double tmp;
if (b <= -2.4e+148) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.22e-126) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else if (b <= 9e+119) {
tmp = -0.3333333333333333 * (((((b * b) - (b * b)) + (((a * c) * -3.0) - t_0)) / (b + Math.sqrt(((b * b) + (t_0 - (a * (c * -3.0))))))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): t_0 = c * (-3.0 * (a + a)) tmp = 0 if b <= -2.4e+148: tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)) elif b <= 1.22e-126: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) elif b <= 9e+119: tmp = -0.3333333333333333 * (((((b * b) - (b * b)) + (((a * c) * -3.0) - t_0)) / (b + math.sqrt(((b * b) + (t_0 - (a * (c * -3.0))))))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) t_0 = Float64(c * Float64(-3.0 * Float64(a + a))) tmp = 0.0 if (b <= -2.4e+148) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(0.5 * Float64(c / b))); elseif (b <= 1.22e-126) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); elseif (b <= 9e+119) tmp = Float64(-0.3333333333333333 * Float64(Float64(Float64(Float64(Float64(b * b) - Float64(b * b)) + Float64(Float64(Float64(a * c) * -3.0) - t_0)) / Float64(b + sqrt(Float64(Float64(b * b) + Float64(t_0 - Float64(a * Float64(c * -3.0))))))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) t_0 = c * (-3.0 * (a + a)); tmp = 0.0; if (b <= -2.4e+148) tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)); elseif (b <= 1.22e-126) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); elseif (b <= 9e+119) tmp = -0.3333333333333333 * (((((b * b) - (b * b)) + (((a * c) * -3.0) - t_0)) / (b + sqrt(((b * b) + (t_0 - (a * (c * -3.0))))))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(-3.0 * N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.4e+148], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.22e-126], 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+119], N[(-0.3333333333333333 * N[(N[(N[(N[(N[(b * b), $MachinePrecision] - N[(b * b), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(t$95$0 - N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := c \cdot \left(-3 \cdot \left(a + a\right)\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{+148}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 1.22 \cdot 10^{-126}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{elif}\;b \leq 9 \cdot 10^{+119}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{\frac{\left(b \cdot b - b \cdot b\right) + \left(\left(a \cdot c\right) \cdot -3 - t_0\right)}{b + \sqrt{b \cdot b + \left(t_0 - a \cdot \left(c \cdot -3\right)\right)}}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.39999999999999995e148Initial program 42.2%
Taylor expanded in b around -inf 97.5%
associate-*r/97.6%
Applied egg-rr97.6%
if -2.39999999999999995e148 < b < 1.21999999999999996e-126Initial program 84.0%
if 1.21999999999999996e-126 < b < 9.00000000000000039e119Initial program 32.6%
/-rgt-identity32.6%
metadata-eval32.6%
associate-/l*32.6%
associate-*r/32.6%
*-commutative32.6%
associate-*l/32.6%
associate-*r/32.6%
metadata-eval32.6%
metadata-eval32.6%
times-frac32.6%
neg-mul-132.6%
distribute-rgt-neg-in32.6%
times-frac32.7%
metadata-eval32.7%
neg-mul-132.7%
Simplified32.7%
associate-*r*32.6%
*-commutative32.6%
metadata-eval32.6%
distribute-lft-neg-in32.6%
fma-neg32.6%
associate-*r*32.7%
prod-diff32.5%
*-commutative32.5%
associate-*r*32.4%
fma-neg32.4%
associate-+l-32.4%
Applied egg-rr32.4%
flip--32.3%
add-sqr-sqrt32.3%
associate--r-32.3%
distribute-rgt-out32.3%
associate--r-32.3%
Applied egg-rr32.3%
associate-+l-32.3%
associate-*l*32.0%
associate-+l-32.0%
associate-*l*32.1%
Simplified32.1%
associate--r-79.5%
associate-*r*79.4%
Applied egg-rr79.4%
if 9.00000000000000039e119 < b Initial program 7.4%
Taylor expanded in b around inf 98.1%
associate-*r/98.1%
Applied egg-rr98.1%
Final simplification88.3%
(FPCore (a b c)
:precision binary64
(if (<= b -3e+130)
(/ (fma b -2.0 (* (/ c (/ b a)) 1.5)) (* a 3.0))
(if (<= b 3e-118)
(* -0.3333333333333333 (/ (- b (sqrt (- (* b b) (* c (* a 3.0))))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3e+130) {
tmp = fma(b, -2.0, ((c / (b / a)) * 1.5)) / (a * 3.0);
} else if (b <= 3e-118) {
tmp = -0.3333333333333333 * ((b - sqrt(((b * b) - (c * (a * 3.0))))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -3e+130) tmp = Float64(fma(b, -2.0, Float64(Float64(c / Float64(b / a)) * 1.5)) / Float64(a * 3.0)); elseif (b <= 3e-118) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0))))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -3e+130], N[(N[(b * -2.0 + N[(N[(c / N[(b / a), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-118], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{+130}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-118}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.9999999999999999e130Initial program 51.4%
Taylor expanded in b around -inf 97.8%
+-commutative97.8%
*-commutative97.8%
fma-def97.8%
*-commutative97.8%
associate-/l*97.9%
Simplified97.9%
if -2.9999999999999999e130 < b < 3.00000000000000018e-118Initial program 81.6%
/-rgt-identity81.6%
metadata-eval81.6%
associate-/l*81.6%
associate-*r/81.5%
*-commutative81.5%
associate-*l/81.6%
associate-*r/81.6%
metadata-eval81.6%
metadata-eval81.6%
times-frac81.6%
neg-mul-181.6%
distribute-rgt-neg-in81.6%
times-frac81.4%
metadata-eval81.4%
neg-mul-181.4%
Simplified81.5%
associate-*r*81.4%
*-commutative81.4%
metadata-eval81.4%
distribute-lft-neg-in81.4%
fma-neg81.4%
associate-*r*81.4%
prod-diff80.9%
*-commutative80.9%
associate-*r*81.0%
fma-neg81.0%
associate-+l-81.0%
Applied egg-rr81.0%
Taylor expanded in a around 0 81.5%
distribute-rgt-out--81.5%
metadata-eval81.5%
*-commutative81.5%
associate-*l*81.4%
*-commutative81.4%
Simplified81.4%
if 3.00000000000000018e-118 < b Initial program 17.9%
Taylor expanded in b around inf 86.4%
associate-*r/86.5%
Applied egg-rr86.5%
Final simplification86.5%
(FPCore (a b c)
:precision binary64
(if (<= b -1.8e+148)
(+ (/ (* b -0.6666666666666666) a) (* 0.5 (/ c b)))
(if (<= b 1.5e-117)
(/ (- (sqrt (- (* b b) (* (* a c) 3.0))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.8e+148) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.5e-117) {
tmp = (sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-1.8d+148)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + (0.5d0 * (c / b))
else if (b <= 1.5d-117) then
tmp = (sqrt(((b * b) - ((a * c) * 3.0d0))) - b) / (a * 3.0d0)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -1.8e+148) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.5e-117) {
tmp = (Math.sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.8e+148: tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)) elif b <= 1.5e-117: tmp = (math.sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.8e+148) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(0.5 * Float64(c / b))); elseif (b <= 1.5e-117) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * c) * 3.0))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1.8e+148) tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)); elseif (b <= 1.5e-117) tmp = (sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.8e+148], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-117], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * c), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+148}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 3} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.80000000000000003e148Initial program 42.2%
Taylor expanded in b around -inf 97.5%
associate-*r/97.6%
Applied egg-rr97.6%
if -1.80000000000000003e148 < b < 1.49999999999999996e-117Initial program 82.8%
neg-sub082.8%
associate-+l-82.8%
sub0-neg82.8%
neg-mul-182.8%
associate-*r/82.8%
metadata-eval82.8%
metadata-eval82.8%
times-frac82.8%
*-commutative82.8%
times-frac82.7%
associate-*l/82.8%
Simplified82.8%
if 1.49999999999999996e-117 < b Initial program 17.9%
Taylor expanded in b around inf 86.4%
associate-*r/86.5%
Applied egg-rr86.5%
Final simplification86.6%
(FPCore (a b c)
:precision binary64
(if (<= b -2.25e+148)
(+ (/ (* b -0.6666666666666666) a) (* 0.5 (/ c b)))
(if (<= b 1.5e-117)
(/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.25e+148) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.5e-117) {
tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-2.25d+148)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + (0.5d0 * (c / b))
else if (b <= 1.5d-117) then
tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.25e+148) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.5e-117) {
tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.25e+148: tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)) elif b <= 1.5e-117: tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.25e+148) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(0.5 * Float64(c / b))); elseif (b <= 1.5e-117) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.25e+148) tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)); elseif (b <= 1.5e-117) tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.25e+148], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-117], 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 * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.25 \cdot 10^{+148}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.24999999999999997e148Initial program 42.2%
Taylor expanded in b around -inf 97.5%
associate-*r/97.6%
Applied egg-rr97.6%
if -2.24999999999999997e148 < b < 1.49999999999999996e-117Initial program 82.8%
if 1.49999999999999996e-117 < b Initial program 17.9%
Taylor expanded in b around inf 86.4%
associate-*r/86.5%
Applied egg-rr86.5%
Final simplification86.6%
(FPCore (a b c)
:precision binary64
(if (<= b -5e-58)
(+ (/ (* b -0.6666666666666666) a) (* 0.5 (/ c b)))
(if (<= b 7.6e-118)
(* -0.3333333333333333 (/ (- b (sqrt (* c (* a -3.0)))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -5e-58) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 7.6e-118) {
tmp = -0.3333333333333333 * ((b - sqrt((c * (a * -3.0)))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-5d-58)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + (0.5d0 * (c / b))
else if (b <= 7.6d-118) then
tmp = (-0.3333333333333333d0) * ((b - sqrt((c * (a * (-3.0d0))))) / a)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -5e-58) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 7.6e-118) {
tmp = -0.3333333333333333 * ((b - Math.sqrt((c * (a * -3.0)))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -5e-58: tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)) elif b <= 7.6e-118: tmp = -0.3333333333333333 * ((b - math.sqrt((c * (a * -3.0)))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -5e-58) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(0.5 * Float64(c / b))); elseif (b <= 7.6e-118) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(c * Float64(a * -3.0)))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -5e-58) tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)); elseif (b <= 7.6e-118) tmp = -0.3333333333333333 * ((b - sqrt((c * (a * -3.0)))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -5e-58], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.6e-118], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-58}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 7.6 \cdot 10^{-118}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.99999999999999977e-58Initial program 72.9%
Taylor expanded in b around -inf 90.0%
associate-*r/90.1%
Applied egg-rr90.1%
if -4.99999999999999977e-58 < b < 7.6000000000000002e-118Initial program 71.1%
/-rgt-identity71.1%
metadata-eval71.1%
associate-/l*71.1%
associate-*r/71.0%
*-commutative71.0%
associate-*l/71.1%
associate-*r/71.1%
metadata-eval71.1%
metadata-eval71.1%
times-frac71.1%
neg-mul-171.1%
distribute-rgt-neg-in71.1%
times-frac70.8%
metadata-eval70.8%
neg-mul-170.8%
Simplified70.9%
associate-*r*70.8%
*-commutative70.8%
metadata-eval70.8%
distribute-lft-neg-in70.8%
fma-neg70.8%
associate-*r*70.8%
prod-diff70.1%
*-commutative70.1%
associate-*r*70.1%
fma-neg70.1%
associate-+l-70.1%
Applied egg-rr70.2%
Taylor expanded in b around 0 65.9%
distribute-rgt-out--66.6%
metadata-eval66.6%
associate-*l*66.6%
Simplified66.6%
if 7.6000000000000002e-118 < b Initial program 17.9%
Taylor expanded in b around inf 86.4%
associate-*r/86.5%
Applied egg-rr86.5%
Final simplification82.7%
(FPCore (a b c)
:precision binary64
(if (<= b -4.9e-60)
(+ (/ (* b -0.6666666666666666) a) (* 0.5 (/ c b)))
(if (<= b 1.3e-117)
(/ (- (sqrt (* (* a c) -3.0)) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.9e-60) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.3e-117) {
tmp = (sqrt(((a * c) * -3.0)) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4.9d-60)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + (0.5d0 * (c / b))
else if (b <= 1.3d-117) then
tmp = (sqrt(((a * c) * (-3.0d0))) - b) / (a * 3.0d0)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.9e-60) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 1.3e-117) {
tmp = (Math.sqrt(((a * c) * -3.0)) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.9e-60: tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)) elif b <= 1.3e-117: tmp = (math.sqrt(((a * c) * -3.0)) - b) / (a * 3.0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.9e-60) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(0.5 * Float64(c / b))); elseif (b <= 1.3e-117) tmp = Float64(Float64(sqrt(Float64(Float64(a * c) * -3.0)) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.9e-60) tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)); elseif (b <= 1.3e-117) tmp = (sqrt(((a * c) * -3.0)) - b) / (a * 3.0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.9e-60], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.3e-117], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.9 \cdot 10^{-60}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.89999999999999988e-60Initial program 72.9%
Taylor expanded in b around -inf 90.0%
associate-*r/90.1%
Applied egg-rr90.1%
if -4.89999999999999988e-60 < b < 1.29999999999999992e-117Initial program 71.1%
Taylor expanded in b around 0 66.8%
if 1.29999999999999992e-117 < b Initial program 17.9%
Taylor expanded in b around inf 86.4%
associate-*r/86.5%
Applied egg-rr86.5%
Final simplification82.7%
(FPCore (a b c)
:precision binary64
(if (<= b -3e-59)
(/ (fma b -2.0 (* (/ c (/ b a)) 1.5)) (* a 3.0))
(if (<= b 1.5e-117)
(/ (- (sqrt (* (* a c) -3.0)) b) (* a 3.0))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3e-59) {
tmp = fma(b, -2.0, ((c / (b / a)) * 1.5)) / (a * 3.0);
} else if (b <= 1.5e-117) {
tmp = (sqrt(((a * c) * -3.0)) - b) / (a * 3.0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
function code(a, b, c) tmp = 0.0 if (b <= -3e-59) tmp = Float64(fma(b, -2.0, Float64(Float64(c / Float64(b / a)) * 1.5)) / Float64(a * 3.0)); elseif (b <= 1.5e-117) tmp = Float64(Float64(sqrt(Float64(Float64(a * c) * -3.0)) - b) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
code[a_, b_, c_] := If[LessEqual[b, -3e-59], N[(N[(b * -2.0 + N[(N[(c / N[(b / a), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-117], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3 \cdot 10^{-59}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.0000000000000001e-59Initial program 72.9%
Taylor expanded in b around -inf 90.0%
+-commutative90.0%
*-commutative90.0%
fma-def90.0%
*-commutative90.0%
associate-/l*90.1%
Simplified90.1%
if -3.0000000000000001e-59 < b < 1.49999999999999996e-117Initial program 71.1%
Taylor expanded in b around 0 66.8%
if 1.49999999999999996e-117 < b Initial program 17.9%
Taylor expanded in b around inf 86.4%
associate-*r/86.5%
Applied egg-rr86.5%
Final simplification82.7%
(FPCore (a b c)
:precision binary64
(if (<= b -4.9e-60)
(+ (/ (* b -0.6666666666666666) a) (* 0.5 (/ c b)))
(if (<= b 3.9e-118)
(* -0.3333333333333333 (/ (- (sqrt (* a (* c -3.0)))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -4.9e-60) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 3.9e-118) {
tmp = -0.3333333333333333 * (-sqrt((a * (c * -3.0))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-4.9d-60)) then
tmp = ((b * (-0.6666666666666666d0)) / a) + (0.5d0 * (c / b))
else if (b <= 3.9d-118) then
tmp = (-0.3333333333333333d0) * (-sqrt((a * (c * (-3.0d0)))) / a)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -4.9e-60) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else if (b <= 3.9e-118) {
tmp = -0.3333333333333333 * (-Math.sqrt((a * (c * -3.0))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -4.9e-60: tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)) elif b <= 3.9e-118: tmp = -0.3333333333333333 * (-math.sqrt((a * (c * -3.0))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -4.9e-60) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(0.5 * Float64(c / b))); elseif (b <= 3.9e-118) tmp = Float64(-0.3333333333333333 * Float64(Float64(-sqrt(Float64(a * Float64(c * -3.0)))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -4.9e-60) tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)); elseif (b <= 3.9e-118) tmp = -0.3333333333333333 * (-sqrt((a * (c * -3.0))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -4.9e-60], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e-118], N[(-0.3333333333333333 * N[((-N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.9 \cdot 10^{-60}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{elif}\;b \leq 3.9 \cdot 10^{-118}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{-\sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -4.89999999999999988e-60Initial program 72.9%
Taylor expanded in b around -inf 90.0%
associate-*r/90.1%
Applied egg-rr90.1%
if -4.89999999999999988e-60 < b < 3.90000000000000001e-118Initial program 71.1%
/-rgt-identity71.1%
metadata-eval71.1%
associate-/l*71.1%
associate-*r/71.0%
*-commutative71.0%
associate-*l/71.1%
associate-*r/71.1%
metadata-eval71.1%
metadata-eval71.1%
times-frac71.1%
neg-mul-171.1%
distribute-rgt-neg-in71.1%
times-frac70.8%
metadata-eval70.8%
neg-mul-170.8%
Simplified70.9%
associate-*r*70.8%
*-commutative70.8%
metadata-eval70.8%
distribute-lft-neg-in70.8%
fma-neg70.8%
associate-*r*70.8%
prod-diff70.1%
*-commutative70.1%
associate-*r*70.1%
fma-neg70.1%
associate-+l-70.1%
Applied egg-rr70.2%
Taylor expanded in b around 0 64.3%
mul-1-neg64.3%
distribute-rgt-out--65.0%
metadata-eval65.0%
*-commutative65.0%
associate-*r*65.1%
Simplified65.1%
if 3.90000000000000001e-118 < b Initial program 17.9%
Taylor expanded in b around inf 86.4%
associate-*r/86.5%
Applied egg-rr86.5%
Final simplification82.3%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (+ (* 0.5 (/ c b)) (* -0.6666666666666666 (/ b a))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / 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 <= (-1d-310)) then
tmp = (0.5d0 * (c / b)) + ((-0.6666666666666666d0) * (b / 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 <= -1e-310) {
tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / a));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / a)) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(Float64(0.5 * Float64(c / b)) + Float64(-0.6666666666666666 * Float64(b / a))); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -1e-310) tmp = (0.5 * (c / b)) + (-0.6666666666666666 * (b / a)); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
\;\;\;\;0.5 \cdot \frac{c}{b} + -0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 70.5%
Taylor expanded in b around -inf 69.8%
if -9.999999999999969e-311 < b Initial program 32.2%
Taylor expanded in b around inf 68.2%
associate-*r/68.2%
Applied egg-rr68.2%
Final simplification69.0%
(FPCore (a b c) :precision binary64 (if (<= b -1e-310) (+ (/ (* b -0.6666666666666666) a) (* 0.5 (/ c b))) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e-310) {
tmp = ((b * -0.6666666666666666) / 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 <= (-1d-310)) then
tmp = ((b * (-0.6666666666666666d0)) / 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 <= -1e-310) {
tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b));
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e-310: tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e-310) tmp = Float64(Float64(Float64(b * -0.6666666666666666) / 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 <= -1e-310) tmp = ((b * -0.6666666666666666) / a) + (0.5 * (c / b)); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $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 -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + 0.5 \cdot \frac{c}{b}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -9.999999999999969e-311Initial program 70.5%
Taylor expanded in b around -inf 69.8%
associate-*r/69.8%
Applied egg-rr69.8%
if -9.999999999999969e-311 < b Initial program 32.2%
Taylor expanded in b around inf 68.2%
associate-*r/68.2%
Applied egg-rr68.2%
Final simplification69.1%
(FPCore (a b c) :precision binary64 (if (<= b 1.1e-301) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.1e-301) {
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.1d-301) 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.1e-301) {
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.1e-301: 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.1e-301) tmp = Float64(Float64(b * -2.0) / Float64(a * 3.0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.1e-301) 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.1e-301], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{-301}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.1e-301Initial program 70.8%
Taylor expanded in b around -inf 69.2%
*-commutative69.2%
Simplified69.2%
if 1.1e-301 < b Initial program 31.7%
Taylor expanded in b around inf 68.7%
associate-*r/68.8%
Applied egg-rr68.8%
Final simplification69.0%
(FPCore (a b c) :precision binary64 (if (<= b 1.2e-301) (* -0.6666666666666666 (/ b a)) (* (/ c b) -0.5)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.2e-301) {
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.2d-301) 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.2e-301) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c / b) * -0.5;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.2e-301: tmp = -0.6666666666666666 * (b / a) else: tmp = (c / b) * -0.5 return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.2e-301) 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.2e-301) tmp = -0.6666666666666666 * (b / a); else tmp = (c / b) * -0.5; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.2e-301], 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.2 \cdot 10^{-301}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\
\end{array}
\end{array}
if b < 1.19999999999999996e-301Initial program 70.8%
Taylor expanded in b around -inf 69.1%
*-commutative69.1%
Simplified69.1%
if 1.19999999999999996e-301 < b Initial program 31.7%
Taylor expanded in b around inf 68.7%
Final simplification68.9%
(FPCore (a b c) :precision binary64 (if (<= b 1.15e-301) (* -0.6666666666666666 (/ b a)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.15e-301) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.15d-301) then
tmp = (-0.6666666666666666d0) * (b / a)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.15e-301) {
tmp = -0.6666666666666666 * (b / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.15e-301: tmp = -0.6666666666666666 * (b / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.15e-301) tmp = Float64(-0.6666666666666666 * Float64(b / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.15e-301) tmp = -0.6666666666666666 * (b / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.15e-301], N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.15 \cdot 10^{-301}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.1500000000000001e-301Initial program 70.8%
Taylor expanded in b around -inf 69.1%
*-commutative69.1%
Simplified69.1%
if 1.1500000000000001e-301 < b Initial program 31.7%
Taylor expanded in b around inf 68.7%
associate-*r/68.8%
Applied egg-rr68.8%
Final simplification68.9%
(FPCore (a b c) :precision binary64 (if (<= b 1.58e-301) (/ (* b -0.6666666666666666) a) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.58e-301) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.58d-301) then
tmp = (b * (-0.6666666666666666d0)) / a
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.58e-301) {
tmp = (b * -0.6666666666666666) / a;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.58e-301: tmp = (b * -0.6666666666666666) / a else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.58e-301) tmp = Float64(Float64(b * -0.6666666666666666) / a); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.58e-301) tmp = (b * -0.6666666666666666) / a; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.58e-301], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.58 \cdot 10^{-301}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 1.57999999999999995e-301Initial program 70.8%
Taylor expanded in b around -inf 69.1%
*-commutative69.1%
Simplified69.1%
associate-*l/69.1%
Applied egg-rr69.1%
if 1.57999999999999995e-301 < b Initial program 31.7%
Taylor expanded in b around inf 68.7%
associate-*r/68.8%
Applied egg-rr68.8%
Final simplification69.0%
(FPCore (a b c) :precision binary64 (* (/ c b) -0.5))
double code(double a, double b, double c) {
return (c / b) * -0.5;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (c / b) * (-0.5d0)
end function
public static double code(double a, double b, double c) {
return (c / b) * -0.5;
}
def code(a, b, c): return (c / b) * -0.5
function code(a, b, c) return Float64(Float64(c / b) * -0.5) end
function tmp = code(a, b, c) tmp = (c / b) * -0.5; end
code[a_, b_, c_] := N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]
\begin{array}{l}
\\
\frac{c}{b} \cdot -0.5
\end{array}
Initial program 51.8%
Taylor expanded in b around inf 34.5%
Final simplification34.5%
herbie shell --seed 2023181
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))