
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c) :precision binary64 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c): return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c) return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a)) end
function tmp = code(a, b, c) tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a); end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\end{array}
(FPCore (a b c)
:precision binary64
(if (<= b -1e+153)
(/ (* b -2.0) (* 3.0 a))
(if (<= b 2e-54)
(/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e+153) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= 2e-54) {
tmp = (sqrt(((b * b) - ((3.0 * a) * c))) - b) / (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 <= (-1d+153)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= 2d-54) then
tmp = (sqrt(((b * b) - ((3.0d0 * a) * c))) - b) / (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 <= -1e+153) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= 2e-54) {
tmp = (Math.sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e+153: tmp = (b * -2.0) / (3.0 * a) elif b <= 2e-54: tmp = (math.sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e+153) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= 2e-54) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c))) - b) / Float64(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 <= -1e+153) tmp = (b * -2.0) / (3.0 * a); elseif (b <= 2e-54) tmp = (sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e+153], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-54], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+153}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1e153Initial program 38.9%
neg-sub038.9%
associate-+l-38.9%
sub0-neg38.9%
neg-mul-138.9%
associate-*r/38.9%
metadata-eval38.9%
metadata-eval38.9%
times-frac38.9%
*-commutative38.9%
times-frac38.9%
associate-*l/38.9%
Simplified38.9%
Taylor expanded in b around -inf 99.8%
*-commutative99.8%
Simplified99.8%
if -1e153 < b < 2.0000000000000001e-54Initial program 84.4%
if 2.0000000000000001e-54 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification89.8%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (* -0.3333333333333333 (/ (- b (sqrt (* (* a c) -3.0))) a))))
(if (<= b -3.2e-45)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -9.5e-106)
t_0
(if (<= b -1.32e-129)
(/ b (/ a -0.6666666666666666))
(if (<= b 5.2e-51) t_0 (/ (* c -0.5) b)))))))
double code(double a, double b, double c) {
double t_0 = -0.3333333333333333 * ((b - sqrt(((a * c) * -3.0))) / a);
double tmp;
if (b <= -3.2e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -9.5e-106) {
tmp = t_0;
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 5.2e-51) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (-0.3333333333333333d0) * ((b - sqrt(((a * c) * (-3.0d0)))) / a)
if (b <= (-3.2d-45)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= (-9.5d-106)) then
tmp = t_0
else if (b <= (-1.32d-129)) then
tmp = b / (a / (-0.6666666666666666d0))
else if (b <= 5.2d-51) then
tmp = t_0
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 = -0.3333333333333333 * ((b - Math.sqrt(((a * c) * -3.0))) / a);
double tmp;
if (b <= -3.2e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -9.5e-106) {
tmp = t_0;
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 5.2e-51) {
tmp = t_0;
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): t_0 = -0.3333333333333333 * ((b - math.sqrt(((a * c) * -3.0))) / a) tmp = 0 if b <= -3.2e-45: tmp = (b * -2.0) / (3.0 * a) elif b <= -9.5e-106: tmp = t_0 elif b <= -1.32e-129: tmp = b / (a / -0.6666666666666666) elif b <= 5.2e-51: tmp = t_0 else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) t_0 = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(Float64(a * c) * -3.0))) / a)) tmp = 0.0 if (b <= -3.2e-45) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= -9.5e-106) tmp = t_0; elseif (b <= -1.32e-129) tmp = Float64(b / Float64(a / -0.6666666666666666)); elseif (b <= 5.2e-51) tmp = t_0; else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) t_0 = -0.3333333333333333 * ((b - sqrt(((a * c) * -3.0))) / a); tmp = 0.0; if (b <= -3.2e-45) tmp = (b * -2.0) / (3.0 * a); elseif (b <= -9.5e-106) tmp = t_0; elseif (b <= -1.32e-129) tmp = b / (a / -0.6666666666666666); elseif (b <= 5.2e-51) tmp = t_0; else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.2e-45], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -9.5e-106], t$95$0, If[LessEqual[b, -1.32e-129], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-51], t$95$0, N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.3333333333333333 \cdot \frac{b - \sqrt{\left(a \cdot c\right) \cdot -3}}{a}\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -9.5 \cdot 10^{-106}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-51}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.20000000000000007e-45Initial program 64.3%
neg-sub064.3%
associate-+l-64.3%
sub0-neg64.3%
neg-mul-164.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
times-frac64.3%
*-commutative64.3%
times-frac64.2%
associate-*l/64.3%
Simplified64.3%
Taylor expanded in b around -inf 85.3%
*-commutative85.3%
Simplified85.3%
if -3.20000000000000007e-45 < b < -9.4999999999999994e-106 or -1.31999999999999992e-129 < b < 5.2e-51Initial program 80.8%
/-rgt-identity80.8%
metadata-eval80.8%
associate-/l*80.8%
associate-*r/80.6%
*-commutative80.6%
associate-*l/80.8%
associate-*r/80.8%
metadata-eval80.8%
metadata-eval80.8%
times-frac80.8%
neg-mul-180.8%
distribute-rgt-neg-in80.8%
times-frac80.4%
metadata-eval80.4%
neg-mul-180.4%
Simplified80.3%
Taylor expanded in b around 0 76.4%
if -9.4999999999999994e-106 < b < -1.31999999999999992e-129Initial program 99.7%
/-rgt-identity99.7%
metadata-eval99.7%
associate-/l*99.7%
associate-*r/99.1%
*-commutative99.1%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
times-frac99.7%
neg-mul-199.7%
distribute-rgt-neg-in99.7%
times-frac99.1%
metadata-eval99.1%
neg-mul-199.1%
Simplified99.1%
associate-*r*99.1%
*-commutative99.1%
metadata-eval99.1%
distribute-lft-neg-in99.1%
fma-neg99.1%
*-un-lft-identity99.1%
prod-diff99.1%
Applied egg-rr99.1%
*-rgt-identity99.1%
fma-neg99.1%
fma-udef99.1%
distribute-rgt-in99.1%
*-lft-identity99.1%
associate--r-99.1%
associate--r+99.1%
+-inverses99.1%
neg-sub099.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
metadata-eval99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in b around -inf 99.1%
associate-*r/99.4%
associate-/l*99.7%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in a around 0 99.1%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.7%
Simplified99.7%
if 5.2e-51 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification85.2%
(FPCore (a b c)
:precision binary64
(if (<= b -3.6e-45)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -6.2e-106)
(* -0.3333333333333333 (/ (- b (sqrt (* a (* c -3.0)))) a))
(if (<= b -1.32e-129)
(/ b (/ a -0.6666666666666666))
(if (<= b 8.4e-51)
(* -0.3333333333333333 (/ (- b (sqrt (* (* a c) -3.0))) a))
(/ (* c -0.5) b))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -3.6e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a);
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 8.4e-51) {
tmp = -0.3333333333333333 * ((b - sqrt(((a * c) * -3.0))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-3.6d-45)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= (-6.2d-106)) then
tmp = (-0.3333333333333333d0) * ((b - sqrt((a * (c * (-3.0d0))))) / a)
else if (b <= (-1.32d-129)) then
tmp = b / (a / (-0.6666666666666666d0))
else if (b <= 8.4d-51) then
tmp = (-0.3333333333333333d0) * ((b - sqrt(((a * c) * (-3.0d0)))) / a)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -3.6e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * ((b - Math.sqrt((a * (c * -3.0)))) / a);
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 8.4e-51) {
tmp = -0.3333333333333333 * ((b - Math.sqrt(((a * c) * -3.0))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -3.6e-45: tmp = (b * -2.0) / (3.0 * a) elif b <= -6.2e-106: tmp = -0.3333333333333333 * ((b - math.sqrt((a * (c * -3.0)))) / a) elif b <= -1.32e-129: tmp = b / (a / -0.6666666666666666) elif b <= 8.4e-51: tmp = -0.3333333333333333 * ((b - math.sqrt(((a * c) * -3.0))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -3.6e-45) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= -6.2e-106) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(a * Float64(c * -3.0)))) / a)); elseif (b <= -1.32e-129) tmp = Float64(b / Float64(a / -0.6666666666666666)); elseif (b <= 8.4e-51) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(Float64(a * c) * -3.0))) / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -3.6e-45) tmp = (b * -2.0) / (3.0 * a); elseif (b <= -6.2e-106) tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a); elseif (b <= -1.32e-129) tmp = b / (a / -0.6666666666666666); elseif (b <= 8.4e-51) tmp = -0.3333333333333333 * ((b - sqrt(((a * c) * -3.0))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -3.6e-45], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.2e-106], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.32e-129], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.4e-51], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.6 \cdot 10^{-45}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{elif}\;b \leq 8.4 \cdot 10^{-51}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{\left(a \cdot c\right) \cdot -3}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -3.60000000000000001e-45Initial program 64.3%
neg-sub064.3%
associate-+l-64.3%
sub0-neg64.3%
neg-mul-164.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
times-frac64.3%
*-commutative64.3%
times-frac64.2%
associate-*l/64.3%
Simplified64.3%
Taylor expanded in b around -inf 85.3%
*-commutative85.3%
Simplified85.3%
if -3.60000000000000001e-45 < b < -6.19999999999999971e-106Initial program 84.7%
/-rgt-identity84.7%
metadata-eval84.7%
associate-/l*84.7%
associate-*r/84.4%
*-commutative84.4%
associate-*l/84.7%
associate-*r/84.7%
metadata-eval84.7%
metadata-eval84.7%
times-frac84.7%
neg-mul-184.7%
distribute-rgt-neg-in84.7%
times-frac84.4%
metadata-eval84.4%
neg-mul-184.4%
Simplified84.5%
Taylor expanded in b around 0 63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.3%
Simplified63.3%
if -6.19999999999999971e-106 < b < -1.31999999999999992e-129Initial program 99.7%
/-rgt-identity99.7%
metadata-eval99.7%
associate-/l*99.7%
associate-*r/99.1%
*-commutative99.1%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
times-frac99.7%
neg-mul-199.7%
distribute-rgt-neg-in99.7%
times-frac99.1%
metadata-eval99.1%
neg-mul-199.1%
Simplified99.1%
associate-*r*99.1%
*-commutative99.1%
metadata-eval99.1%
distribute-lft-neg-in99.1%
fma-neg99.1%
*-un-lft-identity99.1%
prod-diff99.1%
Applied egg-rr99.1%
*-rgt-identity99.1%
fma-neg99.1%
fma-udef99.1%
distribute-rgt-in99.1%
*-lft-identity99.1%
associate--r-99.1%
associate--r+99.1%
+-inverses99.1%
neg-sub099.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
metadata-eval99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in b around -inf 99.1%
associate-*r/99.4%
associate-/l*99.7%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in a around 0 99.1%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.7%
Simplified99.7%
if -1.31999999999999992e-129 < b < 8.40000000000000006e-51Initial program 80.0%
/-rgt-identity80.0%
metadata-eval80.0%
associate-/l*80.0%
associate-*r/79.8%
*-commutative79.8%
associate-*l/80.0%
associate-*r/80.0%
metadata-eval80.0%
metadata-eval80.0%
times-frac80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
times-frac79.6%
metadata-eval79.6%
neg-mul-179.6%
Simplified79.5%
Taylor expanded in b around 0 79.0%
if 8.40000000000000006e-51 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification85.2%
(FPCore (a b c)
:precision binary64
(if (<= b -5.5e-45)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -6.2e-106)
(* -0.3333333333333333 (/ (- b (sqrt (* a (* c -3.0)))) a))
(if (<= b -1.25e-130)
(/ b (/ a -0.6666666666666666))
(if (<= b 9.8e-52)
(* -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 <= -5.5e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a);
} else if (b <= -1.25e-130) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 9.8e-52) {
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 <= (-5.5d-45)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= (-6.2d-106)) then
tmp = (-0.3333333333333333d0) * ((b - sqrt((a * (c * (-3.0d0))))) / a)
else if (b <= (-1.25d-130)) then
tmp = b / (a / (-0.6666666666666666d0))
else if (b <= 9.8d-52) 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 <= -5.5e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * ((b - Math.sqrt((a * (c * -3.0)))) / a);
} else if (b <= -1.25e-130) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 9.8e-52) {
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 <= -5.5e-45: tmp = (b * -2.0) / (3.0 * a) elif b <= -6.2e-106: tmp = -0.3333333333333333 * ((b - math.sqrt((a * (c * -3.0)))) / a) elif b <= -1.25e-130: tmp = b / (a / -0.6666666666666666) elif b <= 9.8e-52: 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 <= -5.5e-45) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= -6.2e-106) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(a * Float64(c * -3.0)))) / a)); elseif (b <= -1.25e-130) tmp = Float64(b / Float64(a / -0.6666666666666666)); elseif (b <= 9.8e-52) 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 <= -5.5e-45) tmp = (b * -2.0) / (3.0 * a); elseif (b <= -6.2e-106) tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a); elseif (b <= -1.25e-130) tmp = b / (a / -0.6666666666666666); elseif (b <= 9.8e-52) 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, -5.5e-45], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.2e-106], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.25e-130], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.8e-52], 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.5 \cdot 10^{-45}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{elif}\;b \leq -1.25 \cdot 10^{-130}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{elif}\;b \leq 9.8 \cdot 10^{-52}:\\
\;\;\;\;-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 < -5.5000000000000003e-45Initial program 64.3%
neg-sub064.3%
associate-+l-64.3%
sub0-neg64.3%
neg-mul-164.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
times-frac64.3%
*-commutative64.3%
times-frac64.2%
associate-*l/64.3%
Simplified64.3%
Taylor expanded in b around -inf 85.3%
*-commutative85.3%
Simplified85.3%
if -5.5000000000000003e-45 < b < -6.19999999999999971e-106Initial program 84.7%
/-rgt-identity84.7%
metadata-eval84.7%
associate-/l*84.7%
associate-*r/84.4%
*-commutative84.4%
associate-*l/84.7%
associate-*r/84.7%
metadata-eval84.7%
metadata-eval84.7%
times-frac84.7%
neg-mul-184.7%
distribute-rgt-neg-in84.7%
times-frac84.4%
metadata-eval84.4%
neg-mul-184.4%
Simplified84.5%
Taylor expanded in b around 0 63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.3%
Simplified63.3%
if -6.19999999999999971e-106 < b < -1.2499999999999999e-130Initial program 99.7%
/-rgt-identity99.7%
metadata-eval99.7%
associate-/l*99.7%
associate-*r/99.1%
*-commutative99.1%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
times-frac99.7%
neg-mul-199.7%
distribute-rgt-neg-in99.7%
times-frac99.1%
metadata-eval99.1%
neg-mul-199.1%
Simplified99.1%
associate-*r*99.1%
*-commutative99.1%
metadata-eval99.1%
distribute-lft-neg-in99.1%
fma-neg99.1%
*-un-lft-identity99.1%
prod-diff99.1%
Applied egg-rr99.1%
*-rgt-identity99.1%
fma-neg99.1%
fma-udef99.1%
distribute-rgt-in99.1%
*-lft-identity99.1%
associate--r-99.1%
associate--r+99.1%
+-inverses99.1%
neg-sub099.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
metadata-eval99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in b around -inf 99.1%
associate-*r/99.4%
associate-/l*99.7%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in a around 0 99.1%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.7%
Simplified99.7%
if -1.2499999999999999e-130 < b < 9.80000000000000037e-52Initial program 80.0%
/-rgt-identity80.0%
metadata-eval80.0%
associate-/l*80.0%
associate-*r/79.8%
*-commutative79.8%
associate-*l/80.0%
associate-*r/80.0%
metadata-eval80.0%
metadata-eval80.0%
times-frac80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
times-frac79.6%
metadata-eval79.6%
neg-mul-179.6%
Simplified79.5%
Taylor expanded in b around 0 79.0%
*-commutative79.0%
associate-*l*79.1%
Simplified79.1%
if 9.80000000000000037e-52 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -2.4e-45)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -6.2e-106)
(* -0.3333333333333333 (/ (- b (sqrt (* a (* c -3.0)))) a))
(if (<= b -9e-134)
(/ b (/ a -0.6666666666666666))
(if (<= b 4.4e-55)
(* (- b (sqrt (* c (* a -3.0)))) (/ -0.3333333333333333 a))
(/ (* c -0.5) b))))))
double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a);
} else if (b <= -9e-134) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 4.4e-55) {
tmp = (b - sqrt((c * (a * -3.0)))) * (-0.3333333333333333 / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= (-2.4d-45)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= (-6.2d-106)) then
tmp = (-0.3333333333333333d0) * ((b - sqrt((a * (c * (-3.0d0))))) / a)
else if (b <= (-9d-134)) then
tmp = b / (a / (-0.6666666666666666d0))
else if (b <= 4.4d-55) then
tmp = (b - sqrt((c * (a * (-3.0d0))))) * ((-0.3333333333333333d0) / a)
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= -2.4e-45) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * ((b - Math.sqrt((a * (c * -3.0)))) / a);
} else if (b <= -9e-134) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 4.4e-55) {
tmp = (b - Math.sqrt((c * (a * -3.0)))) * (-0.3333333333333333 / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -2.4e-45: tmp = (b * -2.0) / (3.0 * a) elif b <= -6.2e-106: tmp = -0.3333333333333333 * ((b - math.sqrt((a * (c * -3.0)))) / a) elif b <= -9e-134: tmp = b / (a / -0.6666666666666666) elif b <= 4.4e-55: tmp = (b - math.sqrt((c * (a * -3.0)))) * (-0.3333333333333333 / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -2.4e-45) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= -6.2e-106) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(a * Float64(c * -3.0)))) / a)); elseif (b <= -9e-134) tmp = Float64(b / Float64(a / -0.6666666666666666)); elseif (b <= 4.4e-55) tmp = Float64(Float64(b - sqrt(Float64(c * Float64(a * -3.0)))) * Float64(-0.3333333333333333 / a)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= -2.4e-45) tmp = (b * -2.0) / (3.0 * a); elseif (b <= -6.2e-106) tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a); elseif (b <= -9e-134) tmp = b / (a / -0.6666666666666666); elseif (b <= 4.4e-55) tmp = (b - sqrt((c * (a * -3.0)))) * (-0.3333333333333333 / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -2.4e-45], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.2e-106], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -9e-134], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.4e-55], N[(N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{elif}\;b \leq -9 \cdot 10^{-134}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-55}:\\
\;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.3999999999999999e-45Initial program 64.3%
neg-sub064.3%
associate-+l-64.3%
sub0-neg64.3%
neg-mul-164.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
times-frac64.3%
*-commutative64.3%
times-frac64.2%
associate-*l/64.3%
Simplified64.3%
Taylor expanded in b around -inf 85.3%
*-commutative85.3%
Simplified85.3%
if -2.3999999999999999e-45 < b < -6.19999999999999971e-106Initial program 84.7%
/-rgt-identity84.7%
metadata-eval84.7%
associate-/l*84.7%
associate-*r/84.4%
*-commutative84.4%
associate-*l/84.7%
associate-*r/84.7%
metadata-eval84.7%
metadata-eval84.7%
times-frac84.7%
neg-mul-184.7%
distribute-rgt-neg-in84.7%
times-frac84.4%
metadata-eval84.4%
neg-mul-184.4%
Simplified84.5%
Taylor expanded in b around 0 63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.3%
Simplified63.3%
if -6.19999999999999971e-106 < b < -9.000000000000001e-134Initial program 99.7%
/-rgt-identity99.7%
metadata-eval99.7%
associate-/l*99.7%
associate-*r/99.1%
*-commutative99.1%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
times-frac99.7%
neg-mul-199.7%
distribute-rgt-neg-in99.7%
times-frac99.1%
metadata-eval99.1%
neg-mul-199.1%
Simplified99.1%
associate-*r*99.1%
*-commutative99.1%
metadata-eval99.1%
distribute-lft-neg-in99.1%
fma-neg99.1%
*-un-lft-identity99.1%
prod-diff99.1%
Applied egg-rr99.1%
*-rgt-identity99.1%
fma-neg99.1%
fma-udef99.1%
distribute-rgt-in99.1%
*-lft-identity99.1%
associate--r-99.1%
associate--r+99.1%
+-inverses99.1%
neg-sub099.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
metadata-eval99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in b around -inf 99.1%
associate-*r/99.4%
associate-/l*99.7%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in a around 0 99.1%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.7%
Simplified99.7%
if -9.000000000000001e-134 < b < 4.3999999999999999e-55Initial program 80.0%
/-rgt-identity80.0%
metadata-eval80.0%
associate-/l*80.0%
associate-*r/79.8%
*-commutative79.8%
associate-*l/80.0%
associate-*r/80.0%
metadata-eval80.0%
metadata-eval80.0%
times-frac80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
times-frac79.6%
metadata-eval79.6%
neg-mul-179.6%
Simplified79.5%
Taylor expanded in b around 0 79.0%
*-commutative79.0%
associate-*l*79.1%
Simplified79.1%
associate-*r/79.4%
Applied egg-rr79.4%
expm1-log1p-u58.7%
expm1-udef22.3%
Applied egg-rr22.3%
expm1-def58.7%
expm1-log1p79.4%
associate-/l*79.3%
associate-/r/79.2%
Simplified79.2%
if 4.3999999999999999e-55 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(let* ((t_0 (- b (sqrt (* a (* c -3.0))))))
(if (<= b -1.5e-44)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -6.2e-106)
(* -0.3333333333333333 (/ t_0 a))
(if (<= b -1.32e-129)
(/ b (/ a -0.6666666666666666))
(if (<= b 3.25e-50)
(/ -0.3333333333333333 (/ a t_0))
(/ (* c -0.5) b)))))))
double code(double a, double b, double c) {
double t_0 = b - sqrt((a * (c * -3.0)));
double tmp;
if (b <= -1.5e-44) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * (t_0 / a);
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 3.25e-50) {
tmp = -0.3333333333333333 / (a / t_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) :: t_0
real(8) :: tmp
t_0 = b - sqrt((a * (c * (-3.0d0))))
if (b <= (-1.5d-44)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= (-6.2d-106)) then
tmp = (-0.3333333333333333d0) * (t_0 / a)
else if (b <= (-1.32d-129)) then
tmp = b / (a / (-0.6666666666666666d0))
else if (b <= 3.25d-50) then
tmp = (-0.3333333333333333d0) / (a / t_0)
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 = b - Math.sqrt((a * (c * -3.0)));
double tmp;
if (b <= -1.5e-44) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -6.2e-106) {
tmp = -0.3333333333333333 * (t_0 / a);
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 3.25e-50) {
tmp = -0.3333333333333333 / (a / t_0);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): t_0 = b - math.sqrt((a * (c * -3.0))) tmp = 0 if b <= -1.5e-44: tmp = (b * -2.0) / (3.0 * a) elif b <= -6.2e-106: tmp = -0.3333333333333333 * (t_0 / a) elif b <= -1.32e-129: tmp = b / (a / -0.6666666666666666) elif b <= 3.25e-50: tmp = -0.3333333333333333 / (a / t_0) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) t_0 = Float64(b - sqrt(Float64(a * Float64(c * -3.0)))) tmp = 0.0 if (b <= -1.5e-44) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= -6.2e-106) tmp = Float64(-0.3333333333333333 * Float64(t_0 / a)); elseif (b <= -1.32e-129) tmp = Float64(b / Float64(a / -0.6666666666666666)); elseif (b <= 3.25e-50) tmp = Float64(-0.3333333333333333 / Float64(a / t_0)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) t_0 = b - sqrt((a * (c * -3.0))); tmp = 0.0; if (b <= -1.5e-44) tmp = (b * -2.0) / (3.0 * a); elseif (b <= -6.2e-106) tmp = -0.3333333333333333 * (t_0 / a); elseif (b <= -1.32e-129) tmp = b / (a / -0.6666666666666666); elseif (b <= 3.25e-50) tmp = -0.3333333333333333 / (a / t_0); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := Block[{t$95$0 = N[(b - N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.5e-44], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.2e-106], N[(-0.3333333333333333 * N[(t$95$0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.32e-129], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.25e-50], N[(-0.3333333333333333 / N[(a / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := b - \sqrt{a \cdot \left(c \cdot -3\right)}\\
\mathbf{if}\;b \leq -1.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{t_0}{a}\\
\mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{elif}\;b \leq 3.25 \cdot 10^{-50}:\\
\;\;\;\;\frac{-0.3333333333333333}{\frac{a}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.5000000000000001e-44Initial program 64.3%
neg-sub064.3%
associate-+l-64.3%
sub0-neg64.3%
neg-mul-164.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
times-frac64.3%
*-commutative64.3%
times-frac64.2%
associate-*l/64.3%
Simplified64.3%
Taylor expanded in b around -inf 85.3%
*-commutative85.3%
Simplified85.3%
if -1.5000000000000001e-44 < b < -6.19999999999999971e-106Initial program 84.7%
/-rgt-identity84.7%
metadata-eval84.7%
associate-/l*84.7%
associate-*r/84.4%
*-commutative84.4%
associate-*l/84.7%
associate-*r/84.7%
metadata-eval84.7%
metadata-eval84.7%
times-frac84.7%
neg-mul-184.7%
distribute-rgt-neg-in84.7%
times-frac84.4%
metadata-eval84.4%
neg-mul-184.4%
Simplified84.5%
Taylor expanded in b around 0 63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.3%
Simplified63.3%
if -6.19999999999999971e-106 < b < -1.31999999999999992e-129Initial program 99.7%
/-rgt-identity99.7%
metadata-eval99.7%
associate-/l*99.7%
associate-*r/99.1%
*-commutative99.1%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
times-frac99.7%
neg-mul-199.7%
distribute-rgt-neg-in99.7%
times-frac99.1%
metadata-eval99.1%
neg-mul-199.1%
Simplified99.1%
associate-*r*99.1%
*-commutative99.1%
metadata-eval99.1%
distribute-lft-neg-in99.1%
fma-neg99.1%
*-un-lft-identity99.1%
prod-diff99.1%
Applied egg-rr99.1%
*-rgt-identity99.1%
fma-neg99.1%
fma-udef99.1%
distribute-rgt-in99.1%
*-lft-identity99.1%
associate--r-99.1%
associate--r+99.1%
+-inverses99.1%
neg-sub099.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
metadata-eval99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in b around -inf 99.1%
associate-*r/99.4%
associate-/l*99.7%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in a around 0 99.1%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.7%
Simplified99.7%
if -1.31999999999999992e-129 < b < 3.24999999999999994e-50Initial program 80.0%
/-rgt-identity80.0%
metadata-eval80.0%
associate-/l*80.0%
associate-*r/79.8%
*-commutative79.8%
associate-*l/80.0%
associate-*r/80.0%
metadata-eval80.0%
metadata-eval80.0%
times-frac80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
times-frac79.6%
metadata-eval79.6%
neg-mul-179.6%
Simplified79.5%
Taylor expanded in b around 0 79.0%
*-commutative79.0%
*-commutative79.0%
associate-*r*79.0%
Simplified79.0%
expm1-log1p-u58.6%
expm1-udef22.3%
Applied egg-rr22.3%
expm1-def58.6%
expm1-log1p79.0%
associate-*r/79.2%
associate-/l*79.2%
Simplified79.2%
if 3.24999999999999994e-50 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -1.2e-43)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -3.5e-105)
(* -0.3333333333333333 (/ (- b (sqrt (* a (* c -3.0)))) a))
(if (<= b -1.32e-129)
(/ b (/ a -0.6666666666666666))
(if (<= b 2.5e-54)
(/ (* -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 <= -1.2e-43) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -3.5e-105) {
tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a);
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 2.5e-54) {
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 <= (-1.2d-43)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= (-3.5d-105)) then
tmp = (-0.3333333333333333d0) * ((b - sqrt((a * (c * (-3.0d0))))) / a)
else if (b <= (-1.32d-129)) then
tmp = b / (a / (-0.6666666666666666d0))
else if (b <= 2.5d-54) 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 <= -1.2e-43) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -3.5e-105) {
tmp = -0.3333333333333333 * ((b - Math.sqrt((a * (c * -3.0)))) / a);
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 2.5e-54) {
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 <= -1.2e-43: tmp = (b * -2.0) / (3.0 * a) elif b <= -3.5e-105: tmp = -0.3333333333333333 * ((b - math.sqrt((a * (c * -3.0)))) / a) elif b <= -1.32e-129: tmp = b / (a / -0.6666666666666666) elif b <= 2.5e-54: 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 <= -1.2e-43) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= -3.5e-105) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(a * Float64(c * -3.0)))) / a)); elseif (b <= -1.32e-129) tmp = Float64(b / Float64(a / -0.6666666666666666)); elseif (b <= 2.5e-54) tmp = Float64(Float64(-0.3333333333333333 * 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 <= -1.2e-43) tmp = (b * -2.0) / (3.0 * a); elseif (b <= -3.5e-105) tmp = -0.3333333333333333 * ((b - sqrt((a * (c * -3.0)))) / a); elseif (b <= -1.32e-129) tmp = b / (a / -0.6666666666666666); elseif (b <= 2.5e-54) 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, -1.2e-43], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.5e-105], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.32e-129], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.5e-54], N[(N[(-0.3333333333333333 * N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{-43}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -3.5 \cdot 10^{-105}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\
\mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.2000000000000001e-43Initial program 64.3%
neg-sub064.3%
associate-+l-64.3%
sub0-neg64.3%
neg-mul-164.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
times-frac64.3%
*-commutative64.3%
times-frac64.2%
associate-*l/64.3%
Simplified64.3%
Taylor expanded in b around -inf 85.3%
*-commutative85.3%
Simplified85.3%
if -1.2000000000000001e-43 < b < -3.5e-105Initial program 84.7%
/-rgt-identity84.7%
metadata-eval84.7%
associate-/l*84.7%
associate-*r/84.4%
*-commutative84.4%
associate-*l/84.7%
associate-*r/84.7%
metadata-eval84.7%
metadata-eval84.7%
times-frac84.7%
neg-mul-184.7%
distribute-rgt-neg-in84.7%
times-frac84.4%
metadata-eval84.4%
neg-mul-184.4%
Simplified84.5%
Taylor expanded in b around 0 63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.3%
Simplified63.3%
if -3.5e-105 < b < -1.31999999999999992e-129Initial program 99.7%
/-rgt-identity99.7%
metadata-eval99.7%
associate-/l*99.7%
associate-*r/99.1%
*-commutative99.1%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
times-frac99.7%
neg-mul-199.7%
distribute-rgt-neg-in99.7%
times-frac99.1%
metadata-eval99.1%
neg-mul-199.1%
Simplified99.1%
associate-*r*99.1%
*-commutative99.1%
metadata-eval99.1%
distribute-lft-neg-in99.1%
fma-neg99.1%
*-un-lft-identity99.1%
prod-diff99.1%
Applied egg-rr99.1%
*-rgt-identity99.1%
fma-neg99.1%
fma-udef99.1%
distribute-rgt-in99.1%
*-lft-identity99.1%
associate--r-99.1%
associate--r+99.1%
+-inverses99.1%
neg-sub099.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
metadata-eval99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in b around -inf 99.1%
associate-*r/99.4%
associate-/l*99.7%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in a around 0 99.1%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.7%
Simplified99.7%
if -1.31999999999999992e-129 < b < 2.50000000000000008e-54Initial program 80.0%
/-rgt-identity80.0%
metadata-eval80.0%
associate-/l*80.0%
associate-*r/79.8%
*-commutative79.8%
associate-*l/80.0%
associate-*r/80.0%
metadata-eval80.0%
metadata-eval80.0%
times-frac80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
times-frac79.6%
metadata-eval79.6%
neg-mul-179.6%
Simplified79.5%
Taylor expanded in b around 0 79.0%
*-commutative79.0%
associate-*l*79.1%
Simplified79.1%
associate-*r/79.4%
Applied egg-rr79.4%
if 2.50000000000000008e-54 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -2e-43)
(/ (* b -2.0) (* 3.0 a))
(if (<= b -7e-106)
(* -0.3333333333333333 (- (/ b a) (/ (sqrt (* a (* c -3.0))) a)))
(if (<= b -1.32e-129)
(/ b (/ a -0.6666666666666666))
(if (<= b 4.3e-51)
(/ (* -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 <= -2e-43) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -7e-106) {
tmp = -0.3333333333333333 * ((b / a) - (sqrt((a * (c * -3.0))) / a));
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 4.3e-51) {
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 <= (-2d-43)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= (-7d-106)) then
tmp = (-0.3333333333333333d0) * ((b / a) - (sqrt((a * (c * (-3.0d0)))) / a))
else if (b <= (-1.32d-129)) then
tmp = b / (a / (-0.6666666666666666d0))
else if (b <= 4.3d-51) 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 <= -2e-43) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= -7e-106) {
tmp = -0.3333333333333333 * ((b / a) - (Math.sqrt((a * (c * -3.0))) / a));
} else if (b <= -1.32e-129) {
tmp = b / (a / -0.6666666666666666);
} else if (b <= 4.3e-51) {
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 <= -2e-43: tmp = (b * -2.0) / (3.0 * a) elif b <= -7e-106: tmp = -0.3333333333333333 * ((b / a) - (math.sqrt((a * (c * -3.0))) / a)) elif b <= -1.32e-129: tmp = b / (a / -0.6666666666666666) elif b <= 4.3e-51: 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 <= -2e-43) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= -7e-106) tmp = Float64(-0.3333333333333333 * Float64(Float64(b / a) - Float64(sqrt(Float64(a * Float64(c * -3.0))) / a))); elseif (b <= -1.32e-129) tmp = Float64(b / Float64(a / -0.6666666666666666)); elseif (b <= 4.3e-51) tmp = Float64(Float64(-0.3333333333333333 * 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 <= -2e-43) tmp = (b * -2.0) / (3.0 * a); elseif (b <= -7e-106) tmp = -0.3333333333333333 * ((b / a) - (sqrt((a * (c * -3.0))) / a)); elseif (b <= -1.32e-129) tmp = b / (a / -0.6666666666666666); elseif (b <= 4.3e-51) 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, -2e-43], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7e-106], N[(-0.3333333333333333 * N[(N[(b / a), $MachinePrecision] - N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.32e-129], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.3e-51], N[(N[(-0.3333333333333333 * N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-43}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq -7 \cdot 10^{-106}:\\
\;\;\;\;-0.3333333333333333 \cdot \left(\frac{b}{a} - \frac{\sqrt{a \cdot \left(c \cdot -3\right)}}{a}\right)\\
\mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{elif}\;b \leq 4.3 \cdot 10^{-51}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -2.00000000000000015e-43Initial program 64.3%
neg-sub064.3%
associate-+l-64.3%
sub0-neg64.3%
neg-mul-164.3%
associate-*r/64.3%
metadata-eval64.3%
metadata-eval64.3%
times-frac64.3%
*-commutative64.3%
times-frac64.2%
associate-*l/64.3%
Simplified64.3%
Taylor expanded in b around -inf 85.3%
*-commutative85.3%
Simplified85.3%
if -2.00000000000000015e-43 < b < -7e-106Initial program 84.7%
/-rgt-identity84.7%
metadata-eval84.7%
associate-/l*84.7%
associate-*r/84.4%
*-commutative84.4%
associate-*l/84.7%
associate-*r/84.7%
metadata-eval84.7%
metadata-eval84.7%
times-frac84.7%
neg-mul-184.7%
distribute-rgt-neg-in84.7%
times-frac84.4%
metadata-eval84.4%
neg-mul-184.4%
Simplified84.5%
Taylor expanded in b around 0 63.0%
*-commutative63.0%
*-commutative63.0%
associate-*r*63.3%
Simplified63.3%
div-sub63.5%
Applied egg-rr63.5%
if -7e-106 < b < -1.31999999999999992e-129Initial program 99.7%
/-rgt-identity99.7%
metadata-eval99.7%
associate-/l*99.7%
associate-*r/99.1%
*-commutative99.1%
associate-*l/99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
times-frac99.7%
neg-mul-199.7%
distribute-rgt-neg-in99.7%
times-frac99.1%
metadata-eval99.1%
neg-mul-199.1%
Simplified99.1%
associate-*r*99.1%
*-commutative99.1%
metadata-eval99.1%
distribute-lft-neg-in99.1%
fma-neg99.1%
*-un-lft-identity99.1%
prod-diff99.1%
Applied egg-rr99.1%
*-rgt-identity99.1%
fma-neg99.1%
fma-udef99.1%
distribute-rgt-in99.1%
*-lft-identity99.1%
associate--r-99.1%
associate--r+99.1%
+-inverses99.1%
neg-sub099.1%
associate-*r*99.1%
*-commutative99.1%
*-commutative99.1%
*-commutative99.1%
distribute-lft-neg-in99.1%
metadata-eval99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in b around -inf 99.1%
associate-*r/99.4%
associate-/l*99.7%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in a around 0 99.1%
associate-*r/99.4%
*-commutative99.4%
associate-/l*99.7%
Simplified99.7%
if -1.31999999999999992e-129 < b < 4.2999999999999997e-51Initial program 80.0%
/-rgt-identity80.0%
metadata-eval80.0%
associate-/l*80.0%
associate-*r/79.8%
*-commutative79.8%
associate-*l/80.0%
associate-*r/80.0%
metadata-eval80.0%
metadata-eval80.0%
times-frac80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
times-frac79.6%
metadata-eval79.6%
neg-mul-179.6%
Simplified79.5%
Taylor expanded in b around 0 79.0%
*-commutative79.0%
associate-*l*79.1%
Simplified79.1%
associate-*r/79.4%
Applied egg-rr79.4%
if 4.2999999999999997e-51 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification85.3%
(FPCore (a b c)
:precision binary64
(if (<= b -1.06e+108)
(/ (* b -2.0) (* 3.0 a))
(if (<= b 3.95e-54)
(* -0.3333333333333333 (/ (- b (sqrt (- (* b b) (* 3.0 (* a c))))) a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1.06e+108) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= 3.95e-54) {
tmp = -0.3333333333333333 * ((b - sqrt(((b * b) - (3.0 * (a * c))))) / 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.06d+108)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= 3.95d-54) then
tmp = (-0.3333333333333333d0) * ((b - sqrt(((b * b) - (3.0d0 * (a * c))))) / 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.06e+108) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= 3.95e-54) {
tmp = -0.3333333333333333 * ((b - Math.sqrt(((b * b) - (3.0 * (a * c))))) / a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1.06e+108: tmp = (b * -2.0) / (3.0 * a) elif b <= 3.95e-54: tmp = -0.3333333333333333 * ((b - math.sqrt(((b * b) - (3.0 * (a * c))))) / a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1.06e+108) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= 3.95e-54) tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c))))) / 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.06e+108) tmp = (b * -2.0) / (3.0 * a); elseif (b <= 3.95e-54) tmp = -0.3333333333333333 * ((b - sqrt(((b * b) - (3.0 * (a * c))))) / a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1.06e+108], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.95e-54], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(3.0 * N[(a * c), $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 -1.06 \cdot 10^{+108}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq 3.95 \cdot 10^{-54}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1.06e108Initial program 50.9%
neg-sub050.9%
associate-+l-50.9%
sub0-neg50.9%
neg-mul-150.9%
associate-*r/50.9%
metadata-eval50.9%
metadata-eval50.9%
times-frac50.9%
*-commutative50.9%
times-frac50.8%
associate-*l/50.9%
Simplified50.9%
Taylor expanded in b around -inf 99.7%
*-commutative99.7%
Simplified99.7%
if -1.06e108 < b < 3.9500000000000002e-54Initial program 83.0%
/-rgt-identity83.0%
metadata-eval83.0%
associate-/l*83.0%
associate-*r/82.8%
*-commutative82.8%
associate-*l/83.0%
associate-*r/83.0%
metadata-eval83.0%
metadata-eval83.0%
times-frac83.0%
neg-mul-183.0%
distribute-rgt-neg-in83.0%
times-frac82.6%
metadata-eval82.6%
neg-mul-182.6%
Simplified82.6%
associate-*r*82.6%
*-commutative82.6%
metadata-eval82.6%
distribute-lft-neg-in82.6%
fma-neg82.6%
*-un-lft-identity82.6%
prod-diff82.3%
Applied egg-rr82.3%
*-rgt-identity82.3%
fma-neg82.3%
fma-udef82.3%
distribute-rgt-in82.3%
*-lft-identity82.3%
associate--r-82.3%
associate--r+82.3%
+-inverses82.6%
neg-sub082.6%
associate-*r*82.6%
*-commutative82.6%
*-commutative82.6%
*-commutative82.6%
distribute-lft-neg-in82.6%
metadata-eval82.6%
*-commutative82.6%
Simplified82.6%
if 3.9500000000000002e-54 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification89.6%
(FPCore (a b c)
:precision binary64
(if (<= b -1e+152)
(/ (* b -2.0) (* 3.0 a))
(if (<= b 1.04e-53)
(/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* 3.0 a))
(/ (* c -0.5) b))))
double code(double a, double b, double c) {
double tmp;
if (b <= -1e+152) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= 1.04e-53) {
tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (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 <= (-1d+152)) then
tmp = (b * (-2.0d0)) / (3.0d0 * a)
else if (b <= 1.04d-53) then
tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (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 <= -1e+152) {
tmp = (b * -2.0) / (3.0 * a);
} else if (b <= 1.04e-53) {
tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (3.0 * a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= -1e+152: tmp = (b * -2.0) / (3.0 * a) elif b <= 1.04e-53: tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (3.0 * a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= -1e+152) tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a)); elseif (b <= 1.04e-53) tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(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 <= -1e+152) tmp = (b * -2.0) / (3.0 * a); elseif (b <= 1.04e-53) tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (3.0 * a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, -1e+152], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.04e-53], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+152}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{elif}\;b \leq 1.04 \cdot 10^{-53}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < -1e152Initial program 38.9%
neg-sub038.9%
associate-+l-38.9%
sub0-neg38.9%
neg-mul-138.9%
associate-*r/38.9%
metadata-eval38.9%
metadata-eval38.9%
times-frac38.9%
*-commutative38.9%
times-frac38.9%
associate-*l/38.9%
Simplified38.9%
Taylor expanded in b around -inf 99.8%
*-commutative99.8%
Simplified99.8%
if -1e152 < b < 1.04000000000000001e-53Initial program 84.4%
neg-sub084.4%
associate-+l-84.4%
sub0-neg84.4%
neg-mul-184.4%
associate-*r/84.4%
metadata-eval84.4%
metadata-eval84.4%
times-frac84.4%
*-commutative84.4%
times-frac84.2%
associate-*l/84.4%
Simplified84.3%
if 1.04000000000000001e-53 < b Initial program 16.0%
/-rgt-identity16.0%
metadata-eval16.0%
associate-/l*16.0%
associate-*r/16.0%
*-commutative16.0%
associate-*l/16.0%
associate-*r/16.0%
metadata-eval16.0%
metadata-eval16.0%
times-frac16.0%
neg-mul-116.0%
distribute-rgt-neg-in16.0%
times-frac16.0%
metadata-eval16.0%
neg-mul-116.0%
Simplified16.0%
associate-*r*16.0%
*-commutative16.0%
metadata-eval16.0%
distribute-lft-neg-in16.0%
fma-neg16.0%
*-un-lft-identity16.0%
prod-diff15.8%
Applied egg-rr15.8%
*-rgt-identity15.8%
fma-neg15.8%
fma-udef15.8%
distribute-rgt-in15.8%
*-lft-identity15.8%
associate--r-15.8%
associate--r+15.8%
+-inverses16.0%
neg-sub016.0%
associate-*r*16.0%
*-commutative16.0%
*-commutative16.0%
*-commutative16.0%
distribute-lft-neg-in16.0%
metadata-eval16.0%
*-commutative16.0%
Simplified16.0%
Taylor expanded in b around inf 93.2%
associate-*r/93.2%
*-commutative93.2%
Simplified93.2%
Final simplification89.8%
(FPCore (a b c) :precision binary64 (if (<= b 7.6e-300) (/ (* b -2.0) (* 3.0 a)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-300) {
tmp = (b * -2.0) / (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 <= 7.6d-300) then
tmp = (b * (-2.0d0)) / (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 <= 7.6e-300) {
tmp = (b * -2.0) / (3.0 * a);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 7.6e-300: tmp = (b * -2.0) / (3.0 * a) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 7.6e-300) tmp = Float64(Float64(b * -2.0) / Float64(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 <= 7.6e-300) tmp = (b * -2.0) / (3.0 * a); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 7.6e-300], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.6 \cdot 10^{-300}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 7.60000000000000026e-300Initial program 72.4%
neg-sub072.4%
associate-+l-72.4%
sub0-neg72.4%
neg-mul-172.4%
associate-*r/72.4%
metadata-eval72.4%
metadata-eval72.4%
times-frac72.4%
*-commutative72.4%
times-frac72.3%
associate-*l/72.4%
Simplified72.4%
Taylor expanded in b around -inf 64.8%
*-commutative64.8%
Simplified64.8%
if 7.60000000000000026e-300 < b Initial program 36.2%
/-rgt-identity36.2%
metadata-eval36.2%
associate-/l*36.2%
associate-*r/36.1%
*-commutative36.1%
associate-*l/36.2%
associate-*r/36.2%
metadata-eval36.2%
metadata-eval36.2%
times-frac36.2%
neg-mul-136.2%
distribute-rgt-neg-in36.2%
times-frac36.1%
metadata-eval36.1%
neg-mul-136.1%
Simplified36.1%
associate-*r*36.1%
*-commutative36.1%
metadata-eval36.1%
distribute-lft-neg-in36.1%
fma-neg36.1%
*-un-lft-identity36.1%
prod-diff35.9%
Applied egg-rr35.9%
*-rgt-identity35.9%
fma-neg35.9%
fma-udef35.9%
distribute-rgt-in35.9%
*-lft-identity35.9%
associate--r-35.9%
associate--r+35.9%
+-inverses36.1%
neg-sub036.1%
associate-*r*36.1%
*-commutative36.1%
*-commutative36.1%
*-commutative36.1%
distribute-lft-neg-in36.1%
metadata-eval36.1%
*-commutative36.1%
Simplified36.1%
Taylor expanded in b around inf 68.0%
associate-*r/68.0%
*-commutative68.0%
Simplified68.0%
Final simplification66.3%
(FPCore (a b c) :precision binary64 (if (<= b 7.6e-300) (* b (/ -0.6666666666666666 a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-300) {
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 <= 7.6d-300) 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 <= 7.6e-300) {
tmp = b * (-0.6666666666666666 / a);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 7.6e-300: tmp = b * (-0.6666666666666666 / a) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 7.6e-300) 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 <= 7.6e-300) tmp = b * (-0.6666666666666666 / a); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 7.6e-300], 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 7.6 \cdot 10^{-300}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 7.60000000000000026e-300Initial program 72.4%
/-rgt-identity72.4%
metadata-eval72.4%
associate-/l*72.4%
associate-*r/72.3%
*-commutative72.3%
associate-*l/72.4%
associate-*r/72.4%
metadata-eval72.4%
metadata-eval72.4%
times-frac72.4%
neg-mul-172.4%
distribute-rgt-neg-in72.4%
times-frac72.1%
metadata-eval72.1%
neg-mul-172.1%
Simplified72.1%
associate-*r*72.1%
*-commutative72.1%
metadata-eval72.1%
distribute-lft-neg-in72.1%
fma-neg72.1%
*-un-lft-identity72.1%
prod-diff71.9%
Applied egg-rr71.9%
*-rgt-identity71.9%
fma-neg71.9%
fma-udef71.9%
distribute-rgt-in71.9%
*-lft-identity71.9%
associate--r-71.9%
associate--r+71.9%
+-inverses72.1%
neg-sub072.1%
associate-*r*72.1%
*-commutative72.1%
*-commutative72.1%
*-commutative72.1%
distribute-lft-neg-in72.1%
metadata-eval72.1%
*-commutative72.1%
Simplified72.1%
Taylor expanded in b around -inf 64.6%
associate-*r/64.6%
associate-/l*64.8%
associate-/r/64.7%
Simplified64.7%
if 7.60000000000000026e-300 < b Initial program 36.2%
/-rgt-identity36.2%
metadata-eval36.2%
associate-/r/36.2%
metadata-eval36.2%
metadata-eval36.2%
times-frac36.2%
*-commutative36.2%
times-frac36.1%
*-commutative36.1%
associate-/r*36.1%
associate-*l/36.2%
Simplified36.1%
Taylor expanded in b around inf 68.0%
Final simplification66.3%
(FPCore (a b c) :precision binary64 (if (<= b 1.35e-299) (/ b (/ a -0.6666666666666666)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
double tmp;
if (b <= 1.35e-299) {
tmp = b / (a / -0.6666666666666666);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 1.35d-299) then
tmp = b / (a / (-0.6666666666666666d0))
else
tmp = (-0.5d0) * (c / b)
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 1.35e-299) {
tmp = b / (a / -0.6666666666666666);
} else {
tmp = -0.5 * (c / b);
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 1.35e-299: tmp = b / (a / -0.6666666666666666) else: tmp = -0.5 * (c / b) return tmp
function code(a, b, c) tmp = 0.0 if (b <= 1.35e-299) tmp = Float64(b / Float64(a / -0.6666666666666666)); else tmp = Float64(-0.5 * Float64(c / b)); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 1.35e-299) tmp = b / (a / -0.6666666666666666); else tmp = -0.5 * (c / b); end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 1.35e-299], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{-299}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\
\end{array}
\end{array}
if b < 1.35000000000000001e-299Initial program 72.4%
/-rgt-identity72.4%
metadata-eval72.4%
associate-/l*72.4%
associate-*r/72.3%
*-commutative72.3%
associate-*l/72.4%
associate-*r/72.4%
metadata-eval72.4%
metadata-eval72.4%
times-frac72.4%
neg-mul-172.4%
distribute-rgt-neg-in72.4%
times-frac72.1%
metadata-eval72.1%
neg-mul-172.1%
Simplified72.1%
associate-*r*72.1%
*-commutative72.1%
metadata-eval72.1%
distribute-lft-neg-in72.1%
fma-neg72.1%
*-un-lft-identity72.1%
prod-diff71.9%
Applied egg-rr71.9%
*-rgt-identity71.9%
fma-neg71.9%
fma-udef71.9%
distribute-rgt-in71.9%
*-lft-identity71.9%
associate--r-71.9%
associate--r+71.9%
+-inverses72.1%
neg-sub072.1%
associate-*r*72.1%
*-commutative72.1%
*-commutative72.1%
*-commutative72.1%
distribute-lft-neg-in72.1%
metadata-eval72.1%
*-commutative72.1%
Simplified72.1%
Taylor expanded in b around -inf 64.6%
associate-*r/64.6%
associate-/l*64.8%
associate-/r/64.7%
Simplified64.7%
Taylor expanded in a around 0 64.6%
associate-*r/64.6%
*-commutative64.6%
associate-/l*64.8%
Simplified64.8%
if 1.35000000000000001e-299 < b Initial program 36.2%
/-rgt-identity36.2%
metadata-eval36.2%
associate-/r/36.2%
metadata-eval36.2%
metadata-eval36.2%
times-frac36.2%
*-commutative36.2%
times-frac36.1%
*-commutative36.1%
associate-/r*36.1%
associate-*l/36.2%
Simplified36.1%
Taylor expanded in b around inf 68.0%
Final simplification66.3%
(FPCore (a b c) :precision binary64 (if (<= b 7.6e-300) (/ b (/ a -0.6666666666666666)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-300) {
tmp = b / (a / -0.6666666666666666);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
real(8) function code(a, b, c)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (b <= 7.6d-300) then
tmp = b / (a / (-0.6666666666666666d0))
else
tmp = (c * (-0.5d0)) / b
end if
code = tmp
end function
public static double code(double a, double b, double c) {
double tmp;
if (b <= 7.6e-300) {
tmp = b / (a / -0.6666666666666666);
} else {
tmp = (c * -0.5) / b;
}
return tmp;
}
def code(a, b, c): tmp = 0 if b <= 7.6e-300: tmp = b / (a / -0.6666666666666666) else: tmp = (c * -0.5) / b return tmp
function code(a, b, c) tmp = 0.0 if (b <= 7.6e-300) tmp = Float64(b / Float64(a / -0.6666666666666666)); else tmp = Float64(Float64(c * -0.5) / b); end return tmp end
function tmp_2 = code(a, b, c) tmp = 0.0; if (b <= 7.6e-300) tmp = b / (a / -0.6666666666666666); else tmp = (c * -0.5) / b; end tmp_2 = tmp; end
code[a_, b_, c_] := If[LessEqual[b, 7.6e-300], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.6 \cdot 10^{-300}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c \cdot -0.5}{b}\\
\end{array}
\end{array}
if b < 7.60000000000000026e-300Initial program 72.4%
/-rgt-identity72.4%
metadata-eval72.4%
associate-/l*72.4%
associate-*r/72.3%
*-commutative72.3%
associate-*l/72.4%
associate-*r/72.4%
metadata-eval72.4%
metadata-eval72.4%
times-frac72.4%
neg-mul-172.4%
distribute-rgt-neg-in72.4%
times-frac72.1%
metadata-eval72.1%
neg-mul-172.1%
Simplified72.1%
associate-*r*72.1%
*-commutative72.1%
metadata-eval72.1%
distribute-lft-neg-in72.1%
fma-neg72.1%
*-un-lft-identity72.1%
prod-diff71.9%
Applied egg-rr71.9%
*-rgt-identity71.9%
fma-neg71.9%
fma-udef71.9%
distribute-rgt-in71.9%
*-lft-identity71.9%
associate--r-71.9%
associate--r+71.9%
+-inverses72.1%
neg-sub072.1%
associate-*r*72.1%
*-commutative72.1%
*-commutative72.1%
*-commutative72.1%
distribute-lft-neg-in72.1%
metadata-eval72.1%
*-commutative72.1%
Simplified72.1%
Taylor expanded in b around -inf 64.6%
associate-*r/64.6%
associate-/l*64.8%
associate-/r/64.7%
Simplified64.7%
Taylor expanded in a around 0 64.6%
associate-*r/64.6%
*-commutative64.6%
associate-/l*64.8%
Simplified64.8%
if 7.60000000000000026e-300 < b Initial program 36.2%
/-rgt-identity36.2%
metadata-eval36.2%
associate-/l*36.2%
associate-*r/36.1%
*-commutative36.1%
associate-*l/36.2%
associate-*r/36.2%
metadata-eval36.2%
metadata-eval36.2%
times-frac36.2%
neg-mul-136.2%
distribute-rgt-neg-in36.2%
times-frac36.1%
metadata-eval36.1%
neg-mul-136.1%
Simplified36.1%
associate-*r*36.1%
*-commutative36.1%
metadata-eval36.1%
distribute-lft-neg-in36.1%
fma-neg36.1%
*-un-lft-identity36.1%
prod-diff35.9%
Applied egg-rr35.9%
*-rgt-identity35.9%
fma-neg35.9%
fma-udef35.9%
distribute-rgt-in35.9%
*-lft-identity35.9%
associate--r-35.9%
associate--r+35.9%
+-inverses36.1%
neg-sub036.1%
associate-*r*36.1%
*-commutative36.1%
*-commutative36.1%
*-commutative36.1%
distribute-lft-neg-in36.1%
metadata-eval36.1%
*-commutative36.1%
Simplified36.1%
Taylor expanded in b around inf 68.0%
associate-*r/68.0%
*-commutative68.0%
Simplified68.0%
Final simplification66.3%
(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 55.3%
/-rgt-identity55.3%
metadata-eval55.3%
associate-/r/55.3%
metadata-eval55.3%
metadata-eval55.3%
times-frac55.3%
*-commutative55.3%
times-frac55.2%
*-commutative55.2%
associate-/r*55.1%
associate-*l/55.2%
Simplified55.1%
Taylor expanded in b around inf 33.3%
Final simplification33.3%
herbie shell --seed 2023230
(FPCore (a b c)
:name "Cubic critical"
:precision binary64
(/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))